This is what I have till now : #include <stdio.h> #include <draw.h> #include <ma
ID: 3804138 • Letter: T
Question
This is what I have till now :
#include <stdio.h>
#include <draw.h>
#include <math.h>
void square(void);
void grid(void);
void circle(void);
void circle2(void);
void circle3(void);
void triAngle(void);
void numberSquares(void);
void smileyFace(void);
int main(int argc, char * argv[])
{
square();
grid();
circle();
circle2();
circle3();
triAngle();
return 0;
}
void square(void)
{
draw_begin();
draw_setColor("green");
draw_moveTo(10, 10);
draw_lineTo(10, 50);
draw_lineTo(50, 50);
draw_lineTo(50, 10);
draw_lineTo(10, 10);
draw_finish(1);
}
void circle(void)
{
draw_begin();
draw_setColor("black");
draw_arc(120,50,40,0, M_PI *2, 0);
draw_finish(0);
}
void circle2(void)
{
draw_begin();
draw_setColor("orange");
draw_arc(170,50,40,0, M_PI, 1);
draw_finish(1);
}
void circle3(void)
{
draw_begin();
draw_setColor("blue");
draw_arc(250,50,40, (M_PI / 2), 11, 1);
draw_finish(1);
}
void triAngle(void)
{
}
void numberSquares(void)
{
}
void smileyFace(void)
{
}
void grid(void)
{
}
NEED HELP COMPLETING FOUR FUNCTIONS : triAngle, numberSquares, smileyFace, grid
The available drawing functions are: o draw begin Begin defining a path. This function accepts no arguments. This path ends when draw finish is called. Each path is rendered in a single color. o draw moveTo Move directly to the specified coordinates. Arguments 1. int) the x coordinate to move to 2. int) the y coordinate to move to o draw lineTo Draw a line from the current coordinates to the specified, new coordinates. Arguments 1. (nt the new x coordinate 2. (int) the new ycoordinate o draw arc Draw an arc (some portion of a circle). The arc is drawn according to the argument values Arguments 1. int) the x position of the center of the circle on which the arc is drawn 2. (nt the y position of the center of the circle on which the arc is drawn 3. (nt the radius of the circle on which the arc is drawn 4. (double) the starting angle, measured from the circle's 3 o'clock position 5. (double) the ending angle, measured from the circle's 3 o'clock position 6. (nt a boolean that indicates "anticlockwise e., whether the arc is drawn from the starting angle to the ending angle in a clockwise (if zero) or anticlockwise (if non-zero) direction Angles are measured in radians. There are 2m radians in a complete circle, just as there are 360 degrees in a complete circle You can obtain the value of n by #include Kmath.h> and then referencing the constant M PI. To draw a complete circle centered at coordinates (100, 200), radius 50, you could issue this function callExplanation / Answer
#include <stdio.h>
#include <draw.h>
#include <math.h>
void square(void);
void grid(void);
void circle(void);
void circle2(void);
void circle3(void);
void triAngle(void);
void numberSquares(void);
void smileyFace(void);
int main(int argc, char * argv[])
{
square();
grid();
circle();
circle2();
circle3();
triAngle();
return 0;
}
void square(void)
{
draw_begin();
draw_setColor("green");
draw_moveTo(10, 10);
draw_lineTo(10, 50);
draw_lineTo(50, 50);
draw_lineTo(50, 10);
draw_lineTo(10, 10);
draw_finish(1);
}
void circle(void)
{
draw_begin();
draw_setColor("black");
draw_arc(120,50,40,0, M_PI *2, 0);
draw_finish(0);
}
void circle2(void)
{
draw_begin();
draw_setColor("orange");
draw_arc(170,50,40,0, M_PI, 1);
draw_finish(1);
}
void circle3(void)
{
draw_begin();
draw_setColor("blue");
draw_arc(250,50,40, (M_PI / 2), 11, 1);
draw_finish(1);
}
void triAngle(void)
{
}
void numberSquares(void)
{
}
void smileyFace(void)
{
}
void grid(void)
{
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.