draw arc algorithm

Hi, can someone tell me where to find source code of algorithm,that draws arc ,when are given 3 points of it and a radius, i mean:
drawarc(int x1,int y1,int x2,int y2,int x3,int y3,int radius).
I know the algorith of Bresenham and also the algorithm of middle point, but i can not find source code to see an example of one of these algorithms. Please help me.

Comments

• : Hi, can someone tell me where to find source code of algorithm,that draws arc ,when are given 3 points of it and a radius, i mean:
: drawarc(int x1,int y1,int x2,int y2,int x3,int y3,int radius).
: I know the algorith of Bresenham and also the algorithm of middle point, but i can not find source code to see an example of one of these algorithms. Please help me.
:
do it like this: (psuedo...)
[code]
a = angle between 1 and 2
b = angle between 1 and 3
for c = a to b
draw_point(sin(c)*radius + x1, cos(c)*radius + y1)
next
[/code]
Hope I helped you...

[grey]The one and only [b]Niklas Ulvinge[/b][/grey] [white]aka [b]IDK[/b][/white]

• How hard is it to write the code if you have the algorithm with you ?
Anyway a google search will reveal lots of code.

: : Hi, can someone tell me where to find source code of algorithm,that draws arc ,when are given 3 points of it and a radius, i mean:
: : drawarc(int x1,int y1,int x2,int y2,int x3,int y3,int radius).
: : I know the algorith of Bresenham and also the algorithm of middle point, but i can not find source code to see an example of one of these algorithms. Please help me.
: :
: do it like this: (psuedo...)
: [code]
: a = angle between 1 and 2
: b = angle between 1 and 3
: for c = a to b
: draw_point(sin(c)*radius + x1, cos(c)*radius + y1)
: next
: [/code]
: Hope I helped you...
:
: [grey]The one and only [b]Niklas Ulvinge[/b][/grey] [white]aka [b]IDK[/b][/white]
:
:

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!