Click here to Skip to main content
15,891,136 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Linear line Pin
Dan Neely31-Jul-07 2:09
Dan Neely31-Jul-07 2:09 
AnswerRe: Linear line Pin
Russell'3-Aug-07 4:19
Russell'3-Aug-07 4:19 
GeneralRe: Linear line Pin
Russell'3-Aug-07 4:20
Russell'3-Aug-07 4:20 
AnswerRe: Linear line Pin
stevepqr7-Aug-07 6:02
stevepqr7-Aug-07 6:02 
Questionimages Pin
zainab ibrahim24-Jul-07 22:47
zainab ibrahim24-Jul-07 22:47 
AnswerRe: images Pin
shiraztk26-Jul-07 9:24
shiraztk26-Jul-07 9:24 
QuestionFinding a point on a circle [modified] Pin
max2929720-Jul-07 12:36
max2929720-Jul-07 12:36 
AnswerRe: Finding a point on a circle [modified] Pin
Luc Pattyn20-Jul-07 16:23
sitebuilderLuc Pattyn20-Jul-07 16:23 
Hi Max,

for a real circle with origin (0,0) and radius 1 the coordinates of the point at angle alpha
are given by (cos(alpha), sin(alpha))

Sanity checks: alpha=0 ==> (1,0) alpha=90 ==> (0,1) alpha=180 ==> (-1,0)

multiply by r to enlarge the circle, and add (cx,cy) to translate it.

BTW I expect Math.Sin/Cos to accept radians, not degrees; so you need to convert that
probably based on Math.Pi

for an ellipse it is similar but slightly more complex, dont know by heart.

it is (cx+rx*cos(alpha), cy+ry*sin(alpha))
where rx and ry are the horizontal and vertical radii (that's for an orthogonal ellipse,
one that has its major axes parallel with the coordinate system's axes)

Sanity check: x must and will be in range (cx-rx,cx+rx) and y in range (cy-ry,cy+ry)

Smile | :)




-- modified at 0:30 Saturday 21st July, 2007


GeneralRe: Finding a point on a circle Pin
max2929720-Jul-07 20:09
max2929720-Jul-07 20:09 
GeneralRe: Finding a point on a circle Pin
Luc Pattyn21-Jul-07 0:49
sitebuilderLuc Pattyn21-Jul-07 0:49 
GeneralRe: Finding a point on a circle Pin
Paul Conrad21-Jul-07 5:24
professionalPaul Conrad21-Jul-07 5:24 
GeneralRe: Finding a point on a circle Pin
Luc Pattyn21-Jul-07 6:06
sitebuilderLuc Pattyn21-Jul-07 6:06 
GeneralRe: Finding a point on a circle Pin
Paul Conrad21-Jul-07 6:11
professionalPaul Conrad21-Jul-07 6:11 
GeneralRe: Finding a point on a circle Pin
max2929721-Jul-07 16:31
max2929721-Jul-07 16:31 
GeneralRe: Finding a point on a circle Pin
Paul Conrad21-Jul-07 16:53
professionalPaul Conrad21-Jul-07 16:53 
GeneralRe: Finding a point on a circle Pin
max2929721-Jul-07 17:52
max2929721-Jul-07 17:52 
GeneralRe: Finding a point on a circle Pin
Paul Conrad21-Jul-07 18:01
professionalPaul Conrad21-Jul-07 18:01 
QuestionRe: Finding a point on a circle Pin
David Crow26-Jul-07 10:53
David Crow26-Jul-07 10:53 
QuestionColor Ranges Pin
Malcolm Smart20-Jul-07 5:29
Malcolm Smart20-Jul-07 5:29 
AnswerRe: Color Ranges Pin
Luc Pattyn20-Jul-07 5:45
sitebuilderLuc Pattyn20-Jul-07 5:45 
GeneralRe: Color Ranges Pin
Malcolm Smart20-Jul-07 10:37
Malcolm Smart20-Jul-07 10:37 
GeneralRe: Color Ranges Pin
Paul Conrad20-Jul-07 10:40
professionalPaul Conrad20-Jul-07 10:40 
GeneralRe: Color Ranges Pin
Malcolm Smart20-Jul-07 11:22
Malcolm Smart20-Jul-07 11:22 
GeneralRe: Color Ranges Pin
Paul Conrad20-Jul-07 11:27
professionalPaul Conrad20-Jul-07 11:27 
GeneralRe: Color Ranges Pin
Luc Pattyn20-Jul-07 15:42
sitebuilderLuc Pattyn20-Jul-07 15:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.