Answer the question
In order to leave comments, you need to log in
How to get a rotated line?
How can I get the coordinates of a rotated (for example, 47%) line (x1, y1, x2, y2)?
Maybe there is some kind of algorithm?
I don’t know what else to write, but if you need something, write in the comments.
Thank you.
Answer the question
In order to leave comments, you need to log in
What does it mean to rotate by 47%? Percentage of what? From 180 degrees, from 360?
Around which point to turn?
Put a pencil on the table. Relative to the left near corner of the table, it has the coordinates of the ends. You can measure x1, y1, x2, y2 with a ruler.
Now rotate the pencil by 47%. I would even watch a vid.
I started doing this back in class 8, and there is no analytical geometry there, but I started because I was learning to program 3d graphics, so references to the university are not very appropriate sometimes
you need to multiply the vectors drawn from the origin to the start / end point of the line by the rotation matrix
each of these vectors
, the resulting vectors will point to the beginning and end of the segment rotated around the origin of the coordinate system (points 0,0
) are transferred back. all this can be done using matrices, and you can calculate one matrix at once for 3 transformations
google about transformation matrices / graphics programming and read the basics
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question