graphics - how to draw circular arc with give two points and radius and clockwise direction -


the problem draw arc 2 pints on bitmap radius , clockwise direction.

from one-sentence question, i'm gonna assume you're ok drawing bezier curves. if not, there plenty of information them out there.

anyway, cannot create perfect circular arc bezier curves (or splines). can approximating circle level eye won't able see difference. done 8 quadratic bezier curve segments, each covering 1/8th of circle. i.e. how adobe flash creates circles.

if you're after plain parametrization using sin , cos, it's way easier:

for (float t = 0; t < 2 * math.pi; t+=0.05) {     float x = radius * sin(t);     float y = radius * cos(t); } 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -