vendredi 1 mai 2020

python how to reflect line between 2 points off of line of angle x?

I have x,y and x1,y1 as 2 endpoints of a line, in this case basically the vector. in between them is a line from (0,0) of angle x. How do I model the reflection of the vector on the angled line?

As far as I know, I could just get the line as vectors parallel and perpendicular to the angled line, then negate the perpendicular one. Sadly, I don't know how to do this mathematically.

Best I have is convert it to angle and magnitude, subtract the angled line angle from it, then negate the y value and rotate it back, but this involves a lot of calculation.





Aucun commentaire:

Enregistrer un commentaire