X,Y Coordinates Circle, Different Plane

In summary, the conversation discusses the process of drawing spokes in a circle using mathematical equations. The participant is struggling to get the correct points on the circumference of the circle and is seeking help from others in the forum. It is mentioned that the angle must be in radians, not degrees, and that the Y axis has been inverted. A solution is eventually found by rotating the end points of the spokes.
  • #1
MathFlop
2
0
Hi All

I'm a programmer but hopeless at maths, new to this forum so seriously hoping you can help please.

I need to draw spokes in a circle as part of a program. Like a dartboard or spokes of a wheel.


X = cos(t) and
Y = sin(t)
For a unit circle where t is the angle.

That’s all ok.

Unit circle has origin of 0,0

My circle has an origin 200,200.

Unit circle has coordinates as so:
East: 1,0
North: 0,1
West: -1,0
South: 0,-1

My circle has coordinates as follows:
East: 400,200
North: 200,0
West: 0,200
South: 200,400

Where north south east and west are the outermost points of the circle.
Note that in my circle the Y axis is inverted.

I tried:
X = 200 + cos(t) * 200
Y = 200 + sin(t) * 200

This gets me points on the circumference of the circle for each value of t (the angle).
However the points derived do not correspond to anywhere near where I want them to be. t = 0 is correct, t = 1 gives me a point that looks like an angle greater than 180 degrees.

I just cannot figure this out, hoping you can provide some help, please.

Thank You
John
 
Mathematics news on Phys.org
  • #2
Are you sure you are putting in the angle in the right units? Check if in the language you are using, sin and cos accept an argument in degrees or in radians. Because your equations do parametrize a circle of radius 100 with center point (200, 200) (starting east going counter clockwise).
 
  • #3
Hi CompuChip

Thanks very much for your reply.

You were exactly correct.

I'm using Java.

The Math.cos( a ) and Math.sin( a ) methods do expect 'a' to be in radians not degrees.

So... I translated my angle to radians before submitting to the Math.cos and Math.sin methods.

Now, using that formula previously provided the line does not reach the circumference for every given angle and the angle is still seemiingly random (although probably not, just seemingly).

Anyway, I've solved my delima through a different means. I was able to rotate the end points by X radians. This works for me.

For anyone interested, the Java code is as follows.

Code:
//Within the public void paint( Graphics g ) method:
//After drawing the circle with radius = 200 and origin 0, 0
//Origin 0, 0 remember is the top left point of the square that encloses the circle.
//This gives center points for the circle at 200, 200

Graphics2D g2d = (Graphics2D)g;
g2d.translate(200, 200); //Translate to origin 200, 200 from 0, 0;
  			
for( int i=0; i<NUMBER_OF_LINES; i++ ){ //NUMBER_OF_LINES = num of spokes
g2d.drawLine(0,0,0,radius);
g2d.rotate(2*Math.PI/NUMBER_OF_LINES);
}

Thanks again
John.
 
  • #4
MathFlop said:
Hi All

I'm a programmer but hopeless at maths, new to this forum so seriously hoping you can help please.

I need to draw spokes in a circle as part of a program. Like a dartboard or spokes of a wheel.


X = cos(t) and
Y = sin(t)
For a unit circle where t is the angle.
For what values of t?

That’s all ok.

Unit circle has origin of 0,0

My circle has an origin 200,200.

Unit circle has coordinates as so:
East: 1,0
North: 0,1
West: -1,0
South: 0,-1

My circle has coordinates as follows:
East: 400,200
North: 200,0
West: 0,200
South: 200,400

Where north south east and west are the outermost points of the circle.
Note that in my circle the Y axis is inverted.

I tried:
X = 200 + cos(t) * 200
Y = 200 + sin(t) * 200
Yes, that will work.- except that you said you had "reversed" the y axis. If that is so, you want Y= 200- sin(t)* 200.

This gets me points on the circumference of the circle for each value of t (the angle).
However the points derived do not correspond to anywhere near where I want them to be. t = 0 is correct, t = 1 gives me a point that looks like an angle greater than 180 degrees.
No, it wont. t= 1 radian corresponds to [itex]180/\pi[/itex] degrees, smaller than 180 degrees. It's probably because you did not take into account that swapping of the Y axis. You want t going from 0 to [itex]2\pi[/itex] radians to cover a circle. Then [itex]\pi= 3.14[/itex] radians, approximately, will correspond to 180 degrees[/itex].

I just cannot figure this out, hoping you can provide some help, please.

Thank You
John
 
Last edited by a moderator:

1. What are X and Y coordinates?

X and Y coordinates are a system used to locate points on a plane. The X coordinate represents the horizontal position, while the Y coordinate represents the vertical position. Together, they form a point on the plane.

2. What is a circle on a coordinate plane?

A circle on a coordinate plane is a set of all points that are equidistant from a given point, called the center. The radius of the circle is the distance from the center to any point on the circle. The equation for a circle on a coordinate plane is (x - h)^2 + (y - k)^2 = r^2, where (h,k) is the center and r is the radius.

3. How are X and Y coordinates used to graph a circle?

To graph a circle on a coordinate plane, you will need to plot the center of the circle, then use the radius to plot points around the center. You can do this by finding points that are a certain distance away from the center in both the horizontal (X) and vertical (Y) directions.

4. What is a different plane in terms of X and Y coordinates?

A different plane, also known as a different coordinate system, is a way of representing points on a graph. For example, instead of using a standard X and Y axis, a different plane may use polar coordinates or a logarithmic scale. Each plane has its own set of rules for plotting points and can be used for different types of data.

5. Why are X and Y coordinates important in science?

X and Y coordinates are important in science because they allow us to accurately represent and analyze data on a two-dimensional plane. This is especially useful in fields such as physics, where graphs of position, velocity, and acceleration are commonly used. X and Y coordinates also allow scientists to easily communicate and compare data with others in a standardized format.

Similar threads

Replies
3
Views
1K
  • Introductory Physics Homework Help
Replies
4
Views
746
  • Calculus and Beyond Homework Help
Replies
6
Views
852
  • Precalculus Mathematics Homework Help
Replies
8
Views
1K
  • Precalculus Mathematics Homework Help
Replies
20
Views
2K
  • General Math
Replies
2
Views
1K
  • General Math
Replies
3
Views
2K
  • General Math
Replies
1
Views
2K
Replies
20
Views
3K
Replies
26
Views
3K
Back
Top