Finding a point on a circle [modified]
-
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) :) -- modified at 0:30 Saturday 21st July, 2007
Luc Pattyn
try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }
Thanks a lot! That's pretty much exactly what I needed.
----- *** Never give me an answer having anything to do with Visual Studio. I don't have this because I have two computers, one being my dad's mac, which is connected to the internet, the other being my pc, which is, sadly, not connected to the internet. The setup for the Visual C# program I think is called a "bootstrap" program, and it needs to connect to the internet to install the program. THEREFORE I cannot install this program onto my pc.***
-
Thanks a lot! That's pretty much exactly what I needed.
----- *** Never give me an answer having anything to do with Visual Studio. I don't have this because I have two computers, one being my dad's mac, which is connected to the internet, the other being my pc, which is, sadly, not connected to the internet. The setup for the Visual C# program I think is called a "bootstrap" program, and it needs to connect to the internet to install the program. THEREFORE I cannot install this program onto my pc.***
You're welcome. I am surprised though you asked this, it basically is the definition of cos() and sin(), hence part of trigonometry 101, isnt it ? :)
Luc Pattyn
try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }
-
You're welcome. I am surprised though you asked this, it basically is the definition of cos() and sin(), hence part of trigonometry 101, isnt it ? :)
Luc Pattyn
try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }
Luc Pattyn wrote:
I am surprised though you asked this, it basically is the definition of cos() and sin(), hence part of trigonometry 101
I was curious as to why? Maybe he was just a little rusty on the Trig...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
-
Luc Pattyn wrote:
I am surprised though you asked this, it basically is the definition of cos() and sin(), hence part of trigonometry 101
I was curious as to why? Maybe he was just a little rusty on the Trig...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
Well, I dont expect any of the kids his age in my neighbourhood to ask this kind of question; either they are not interested in programming, math and science, so they dont need it and dont care to ask; or they are interested and hence they remember the definition and the use of cos() and sin() they learned at school, and they are keen enough to figure things out by themselves... In the end, that's what schools are for: provide the basic information and the drive to investigate and discover, isnt it ? But then (this does not apply to Max, he asks lots of mostly good questions in diverse areas, my comment was intended as an extra stimulus for him), I continuously am amazed by the number of people lacking such drive : they ask basic questions on CP, often using the right keywords, but "forget" to search the answers themselves; some of them, when they get a reply refering to CP/MSDN/Google, see it fit to reply with "Can you provide a link ?". :)
Luc Pattyn
try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }
-
Well, I dont expect any of the kids his age in my neighbourhood to ask this kind of question; either they are not interested in programming, math and science, so they dont need it and dont care to ask; or they are interested and hence they remember the definition and the use of cos() and sin() they learned at school, and they are keen enough to figure things out by themselves... In the end, that's what schools are for: provide the basic information and the drive to investigate and discover, isnt it ? But then (this does not apply to Max, he asks lots of mostly good questions in diverse areas, my comment was intended as an extra stimulus for him), I continuously am amazed by the number of people lacking such drive : they ask basic questions on CP, often using the right keywords, but "forget" to search the answers themselves; some of them, when they get a reply refering to CP/MSDN/Google, see it fit to reply with "Can you provide a link ?". :)
Luc Pattyn
try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }
I didn't realize the OP was only 14 years old until I looked at his profile. Trigonometry the Easy Way[^] is a great book I had when I was in high school back in the late '80s. I still have it and it is the second edition. It helped me with my grades.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
-
I didn't realize the OP was only 14 years old until I looked at his profile. Trigonometry the Easy Way[^] is a great book I had when I was in high school back in the late '80s. I still have it and it is the second edition. It helped me with my grades.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
ha! Yeah, I'm kind of going into high school next year so...
----- *** Never give me an answer having anything to do with Visual Studio. I don't have this because I have two computers, one being my dad's mac, which is connected to the internet, the other being my pc, which is, sadly, not connected to the internet. The setup for the Visual C# program I think is called a "bootstrap" program, and it needs to connect to the internet to install the program. THEREFORE I cannot install this program onto my pc.***
-
ha! Yeah, I'm kind of going into high school next year so...
----- *** Never give me an answer having anything to do with Visual Studio. I don't have this because I have two computers, one being my dad's mac, which is connected to the internet, the other being my pc, which is, sadly, not connected to the internet. The setup for the Visual C# program I think is called a "bootstrap" program, and it needs to connect to the internet to install the program. THEREFORE I cannot install this program onto my pc.***
max29297 wrote:
I'm kind of going into high school next year so...
Good luck to you, and any questions about your maths studies are welcome here.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
-
max29297 wrote:
I'm kind of going into high school next year so...
Good luck to you, and any questions about your maths studies are welcome here.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
Thanks!
----- *** Never give me an answer having anything to do with Visual Studio. I don't have this because I have two computers, one being my dad's mac, which is connected to the internet, the other being my pc, which is, sadly, not connected to the internet. The setup for the Visual C# program I think is called a "bootstrap" program, and it needs to connect to the internet to install the program. THEREFORE I cannot install this program onto my pc.***
-
Thanks!
----- *** Never give me an answer having anything to do with Visual Studio. I don't have this because I have two computers, one being my dad's mac, which is connected to the internet, the other being my pc, which is, sadly, not connected to the internet. The setup for the Visual C# program I think is called a "bootstrap" program, and it needs to connect to the internet to install the program. THEREFORE I cannot install this program onto my pc.***
No problem. I'd look at the Douglas Downing book that I posted about earlier. He has an Algebra one, and Calculus one which is really good.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
-
ha! Yeah, I'm kind of going into high school next year so...
----- *** Never give me an answer having anything to do with Visual Studio. I don't have this because I have two computers, one being my dad's mac, which is connected to the internet, the other being my pc, which is, sadly, not connected to the internet. The setup for the Visual C# program I think is called a "bootstrap" program, and it needs to connect to the internet to install the program. THEREFORE I cannot install this program onto my pc.***
How do you "kind of" go into high school? :confused:
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne