Convenience function to make a vector out of two points.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@415 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -44,6 +44,14 @@ public class Vector2
|
||||
return new Vector2(p.x, p.y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Vector2 pointing from s to t.
|
||||
*/
|
||||
public static function fromPoints (s :Point, t :Point) :Vector2
|
||||
{
|
||||
return new Vector2(t.x - s.x, t.y - s.y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a Vector2 of magnitude 'len' that has been rotated about the origin by 'radians'.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user