FastLED 3.10.10
Loading...
Searching...
No Matches

◆ drawStar()

static void drawStar ( float cx,
float cy,
float r,
float spin,
const CRGB & color )
static
Examples
Polygon.ino.

Definition at line 144 of file Polygon.ino.

144 {
145 fl::PolyPoint<float> star[5];
146 for (int i = 0; i < 5; ++i) {
147 const float a = spin + (float)i * (2.0f * 6.2831853f / 5.0f);
148 star[i].x = cx + r * fl::cosf(a);
149 star[i].y = cy + r * fl::sinf(a);
150 }
151 canvas.drawPolygon(color, star); // Exact fill, default MAXN, additive
152}
fl::CanvasRGB canvas(fl::span< CRGB >(leds, NUM_LEDS), WIDTH, HEIGHT)
float sinf(float value) FL_NO_EXCEPT
Definition math.h:360
gfx::PolyPoint< Coord > PolyPoint
Polygon vertex (x, y coordinate pair) for drawPolygon.
Definition gfx.h:57
float cosf(float value) FL_NO_EXCEPT
Definition math.h:366

References canvas, fl::cosf(), fl::sinf(), fl::gfx::PolyPoint< Coord >::x, and fl::gfx::PolyPoint< Coord >::y.

Referenced by sceneStar().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: