Answers for "How to calculate vector perpendicular to a direction vector?"
http://answers.unity.com/questions/1203255/how-to-calculate-vector-perpendicular-to-a-point-o.html
The latest answers for the question "How to calculate vector perpendicular to a direction vector?"Answer by unity_ioeaHQCQ0I7G2A
http://answers.unity.com/answers/1662697/view.html
In 2D:
direction vector = (x,y) =>
normal vector = (-y,x) or (y,-x)
In 3D:
direction vector = (x,y,z) =>
normal vector (in plane y, y stay) = (-z,y,x) or (z,y,-x)Tue, 03 Sep 2019 05:56:57 GMTunity_ioeaHQCQ0I7G2AAnswer by Winterblood
http://answers.unity.com/answers/1203279/view.html
If it's in 2D you can just swap the components and negate one:
blueVector.x = redVector.y;
blueVector.y = -redVector.x;
(You'll probably then want to normalise it so it's a consistent magnitude)
FWIW, the cross product will give you a vector perpendicular to both the input vectors, so it's useless in 2D.
[EDIT] BTW, if you keep adding that tangential velocity it will spiral rapidly outwards, even with damping. I'm guessing you might want it to orbit, in which case you'll need a "gravity" force to stop it flying off.Wed, 15 Jun 2016 19:46:51 GMTWinterblood