ScratchData LogoScratchData
Back to superfireninja9's profile

Rotations with Complex Numbers

SUsuperfireninja9•Created September 2, 2022
Rotations with Complex Numbers
9
6
52 views
View on Scratch

Instructions

An interesting approach to rotations! Normally people will use trigonometry to rotate each point on a field, but with complex numbers, we can Algebraicly rotate a bunch of points around an origin at once! Just create a 2D vector representing the rotation you want to achieve. [cos(angle), sin(angle)]. This is pretty standard. Then turn this into a complex number. (cos(angle) + sin(angle) * I) You then multiply every point in the field by this one number, and it will rotate it! It is extremely efficient, and there can't be any explosions. It is also much easier computationally, meaning you can rotate more points in a single frame than the conventional method. Note that when multiplying complex numbers, you have to follow the complex numbers multiplication rules. You cant just treat it like a vector when multiplying.

Project Details

Project ID727688106
CreatedSeptember 2, 2022
Last ModifiedOctober 18, 2022
SharedOctober 18, 2022
Visibilityvisible
CommentsAllowed