Finding a Point on a Circle
-
This is kind of a tough problem... I'm trying to make a function that will give me the point (in x, y format) on a circle at x degrees. I was thinking somewhere along the lines of...
public Point GetPointOnCircle(int circleX, int circleY, int circleWidth, int circleHeight, int degrees) {
// do some calculating...
return new Point(x, y);
}I've tried to make it on my own, but it's just not working for me... Does anyone have any ideas?
----- *** 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.***
-
This is kind of a tough problem... I'm trying to make a function that will give me the point (in x, y format) on a circle at x degrees. I was thinking somewhere along the lines of...
public Point GetPointOnCircle(int circleX, int circleY, int circleWidth, int circleHeight, int degrees) {
// do some calculating...
return new Point(x, y);
}I've tried to make it on my own, but it's just not working for me... Does anyone have any ideas?
----- *** 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.***
The way to do this is trig. If you know the centre point, then you can build right angle triangles from there and use trig to determine both the x and y point of the triangle for a given angle, use the radius as the length of the hypotenuse. In this way, you can plot your points by stepping around in a circle.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
This is kind of a tough problem... I'm trying to make a function that will give me the point (in x, y format) on a circle at x degrees. I was thinking somewhere along the lines of...
public Point GetPointOnCircle(int circleX, int circleY, int circleWidth, int circleHeight, int degrees) {
// do some calculating...
return new Point(x, y);
}I've tried to make it on my own, but it's just not working for me... Does anyone have any ideas?
----- *** 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.***
It's not tough at all if you've done some algebra in high-school. What you want is to convert polar coordinates to rectangular coordinates. Skipping all the explanations, the coordinates of the point will be: x = r * cos(u) y = r * sin(u) ,where r is the radius of the circle and u is the angle measured beginning from "3 o'clock" and going counterclockwise.
-
It's not tough at all if you've done some algebra in high-school. What you want is to convert polar coordinates to rectangular coordinates. Skipping all the explanations, the coordinates of the point will be: x = r * cos(u) y = r * sin(u) ,where r is the radius of the circle and u is the angle measured beginning from "3 o'clock" and going counterclockwise.
One small additional hint: the angle has to be in radians ( 0 - 2*π ), not degrees. I think this must be said because max12345 seems not to be familiar with elementary trigonometry at all.
Regards, mav -- Black holes are the places where God divided by 0...