678 {
681 constexpr s16x16 half(0.5f);
682 s16x16 cx = s16x16(w - 1) * half;
683 s16x16 cy = s16x16(h - 1) * half;
684
685
687
688
689 constexpr s16x16 k_0742(0.742f);
690 constexpr s16x16 k_0677(0.677f);
691 constexpr s16x16 k_0774(0.774f);
692 constexpr s16x16 k_0710(0.710f);
693 s16x16 cx_r1 = cx * k_0742;
694 s16x16 cy_r1 = cy * k_0677;
695 s16x16 cx_r2 = cx * k_0774;
696 s16x16 cy_r2 = cy * k_0710;
697
698
699 constexpr s16x16 k_113(1.13f);
700 constexpr s16x16 k_171(1.71f);
701 constexpr s16x16 k_189(1.89f);
702 constexpr s16x16 k_137(1.37f);
703 constexpr s16x16 k_020(0.20f);
704 constexpr s16x16 k_130(1.30f);
705 constexpr s16x16 k_220(2.20f);
706 constexpr s16x16 k_070(0.70f);
707
708 s16x16 x1 = cx + cx_r1 *
s16x16::sin(ts * k_113 + k_020);
709 s16x16 y1 = cy + cy_r1 *
s16x16::sin(ts * k_171 + k_130);
710 s16x16 x2 = cx + cx_r2 *
s16x16::sin(ts * k_189 + k_220);
711 s16x16 y2 = cy + cy_r2 *
s16x16::sin(ts * k_137 + k_070);
712
714
717 constexpr s16x16 discDiam(1.7f);
718 drawDot(x1, y1, discDiam, endA.r, endA.g, endA.b);
719 drawDot(x2, y2, discDiam, endB.r, endB.g, endB.b);
720}
void drawAALine(s16x16 x0, s16x16 y0, s16x16 x1, s16x16 y1, s16x16 t, s16x16 colorShift)
void drawDot(s16x16 cx, s16x16 cy, s16x16 diam, u8 cr, u8 cg, u8 cb)
FASTLED_FORCE_INLINE s16x16 sin() const FL_NOEXCEPT