public static Vector2 Perpendicular(Vector2 original) { //To create a perpendicular vector switch X and Y, then make Y negative float x = original.X; float y = original.Y; y = -y; // 或者 x = -x,分别是+pi/2和-pi/2的效果 return new Vector2(y, x); }
public static Vector2 Perpendicular(Vector2 original) { //To create a perpendicular vector switch X and Y, then make Y negative float x = original.X; float y = original.Y; y = -y; // 或者 x = -x,分别是+pi/2和-pi/2的效果 return new Vector2(y, x); }
转载于:https://www.cnblogs.com/thefake/articles/3235680.html