4 ms·
The code also used a neat approximation to draw circles. Instead of using sin and cos for rotating along the edge of the circle to draw it, it simply used x (~=
by thefilmore 4y ago
The code also used a neat approximation to draw circles. Instead of using sin and cos for rotating along the edge of the circle to draw it, it simply used x (~= sin(x) for small values) and 1-x^2/2 (a Taylor series approximation derived from cos(x) = sqrt(1-sin(x)^2)), respectively.
- JoeAltmaier 4y agoI would draw circles using vectors. A vector normal to the last radii long enough to span about 7 degrees would sketch a circle that looked as good as round without drawing too many lines.