Rotating Coordinates by 45 Degrees: A Formula for Graphing Help

Click For Summary
SUMMARY

The discussion centers on the mathematical process of rotating coordinates by 45 degrees, specifically for drawing vertical and horizontal lines relative to a defined center point. The center point is given as (400, 220), with initial lines defined at (500, 220) to (300, 220) for horizontal and (400, 120) to (400, 320) for vertical. Participants emphasize using trigonometric functions, specifically cos() and sin(), to calculate the new coordinates after rotation. The final coordinates for the rotated lines are derived from applying these functions to the original endpoints.

PREREQUISITES
  • Understanding of basic trigonometry, specifically sine and cosine functions.
  • Familiarity with coordinate geometry and how to plot points on a Cartesian plane.
  • Knowledge of rotation transformations in a 2D space.
  • Ability to manipulate and calculate coordinates based on geometric transformations.
NEXT STEPS
  • Learn how to apply rotation matrices for transforming coordinates in 2D space.
  • Study the properties of sine and cosine functions, particularly at common angles like 45 degrees.
  • Explore graphical software or programming libraries that facilitate geometric transformations, such as Python's Matplotlib.
  • Investigate the use of polar coordinates and their relationship to Cartesian coordinates for more complex rotations.
USEFUL FOR

Mathematicians, graphic designers, game developers, and anyone involved in computer graphics or geometric modeling will benefit from this discussion on coordinate rotation.

tuanle007
Messages
35
Reaction score
0
hi,
can someone please help me with this situation.
i have this object.
and i have drawn an oval, the horizontal, and vertical line.

y=145
x=203

when degree = 0

how would i draw the vertial/horizontal line how if it is 45 degree different?
original?v=mpbl-1&px=-1.jpg
 
Physics news on Phys.org
tuanle007 said:
hi,
can someone please help me with this situation.
i have this object.
and i have drawn an oval, the horizontal, and vertical line.

y=145
x=203

when degree = 0

how would i draw the vertial/horizontal line how if it is 45 degree different?
original?v=mpbl-1&px=-1.jpg

If what is 45 degrees different? If the object shown is angled down to the horizontal or up to vertical? Is that what you mean? Can you show us a little more clearly what you are asking about. Seems like straightward trig, unless I'm missing something.
 
I need to redraw the vertical/horizontal line so that it is correct.
i know the angle of the rotation.
i just don't remember how to do my trig to redraw the line.

i want these yellow lines
original?v=mpbl-1&px=-1.jpg
?I have already draw the green lines.
i know that the green line and the yellow line is about 45 degree off?
what can i do if i know the coordinates of the green lines and i want to draw the YELLOW LINES.
I think this is more clear right?
 
Yes, it's making more sense now. How did you define the length of the green lines before? I assume this is the center point?

y=145
x=203

And you did some delta-x to draw the horizontal line, and some delta-y to get the vertical line? You are defining the endpoints of the lines, or the center point and length?

It's just some basic trig to figure out where the end points rotate to when you turn the lines. You will get (x,y) coordinates based on the distance from the center point, and the angle of rotation. You will use cos() and sin() functions to get you the x and y components of the rotation (assuming the angle is taken from the horizontal).
 
okay,
sorry about this..
the x, y value i have given you was from other images..
for this particular one..
the center point is
x=400
y=220

so i start by drawing the red oval.

about 100 points from x and y.
givin 4 points

OVAL
(500,220), (300,220)
(400,220), (400,120)

Vertical line is (400,120), (400, 320)
Horizonal line is (500,220), (300, 220)

knowing the Vertical and Horizontal coordinates.
Can you show me and give me the coordinates for Vertical and Horizontal lines if it is 45 degree different?
 
tuanle007 said:
okay,
sorry about this..
the x, y value i have given you was from other images..
for this particular one..
the center point is
x=400
y=220

so i start by drawing the red oval.

about 100 points from x and y.
givin 4 points

OVAL
(500,220), (300,220)
(400,220), (400,120)

Vertical line is (400,120), (400, 320)
Horizonal line is (500,220), (300, 220)

knowing the Vertical and Horizontal coordinates.
Can you show me and give me the coordinates for Vertical and Horizontal lines if it is 45 degree different?

I'm not sure what the OVAL numbers mean. Do they define an oval shape? If so, can you just connect up lines with them? Are they the major and minor axes' endpoints?

On your question about rotating a line, I'll just give you an example. You should be able to extrapolate how to do it for your particular problem. Take an example of a line 100 units long, going from the origin (0,0) to (100,0). It' obviously horizontal. Now rotate it up CCW by 45 degrees. The endpoint rotates up from (100,0) to (100 cos(45),100 sin(45)). Does that make sense?
 
i sort of understand the (100cos(45),100sin(45))

but for instant my number
Horizonal line is (500,220), (300, 220)
it would be (500,220) to (500cos(45),500sin(45))?
 
okay.
i have 2 end points
(265,218) to (503,218)
and i need to rotate it 45 degree.

what is the formula i can use to do this?

by the axis, i think its roughly about

(313, 290) to (454, 144)

can you help me prove this? the cos(45) and sin(45) doesn't come out close to it for me.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 16 ·
Replies
16
Views
5K
Replies
4
Views
3K
Replies
20
Views
4K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
Replies
21
Views
4K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K