drawArc()
[Graphics]
void drawArc (int x, int y, int radius, float startAngle, float endAngle);Description
Draws an arc on the chip.
Parameters
x: the x-coordinate of the center of the arc.
y: the y-coordinate of the center of the arc.
radius: the radius of the arc.
startAngle: the start angle of the arc.
endAngle: the end angle of the arc.
Returns
Nothing.
Example Code
The code draws an arc in the center of the chip, with a radius of 50 pixels, a start angle of 0 degrees, and an end angle of 90 degrees.
void setup() {
int width = chipWidth(); // gets the width of the chip
int height = chipHeight(); // gets the height of the chip
// draws an arc in the center of the chip, with a radius of 50
// pixels, a start angle of 0 degrees, and an end angle of 90 degrees
drawArc(width / 2, height / 2, 50, 0, 90 * (PI / 180));
}
void loop() {
}Notes and Warnings
- All coordinates must be inside the chip boundaries, use the
functions
chipWidth()andchipHeight()to get the chip dimensions. - The angles are in radians, use the
PIconstant to convert from degrees to radians.
