magnitude:Number [read-only]
Gets the magnitude of the instance
Implementation
public function get magnitude():Number
public var x:Number
public var y:Number
public function Vector(x:Number = 0, y:Number = 0)
Constructor
Parameters
| x:Number (default = 0) — defines { |
| |
| y:Number (default = 0) — defines { |
public function clone():Vector
Returns a Vector identical to the instance
Returns
public function cross(v:Vector):Number
Gets the cross product of the Vector and instance
Parameters
| v:Vector — Vector to evaluate cross product with
|
Returns
| Number — cross product of v and instance
|
public function crossScalar(scalar:Number):VectorParameters
Returns
public function dividedBy(scalar:Number):Vector
Gets the quotient of the instance and passed scalar
Note that this does NOT alter the instance
Parameters
| scalar:Number — scalar by which to divide
|
Returns
| Vector —
quotient of instance and scalar
|
public function dividedByEquals(scalar:Number):void
Divides the instance by a scalar
Note that this alters the Vector
Parameters
| scalar:Number — scalar by which to divide
|
public function dot(v:Vector):Number
Gets the dot product of the Vector and instance
Parameters
| v:Vector — Vector to evaluate dot product with
|
Returns
| Number — the dot product of v and the instance
|
public function getAngle(v:Vector):NumberParameters
Returns
public function getPerp():Vector
Returns
public function getUnit():Vector
Gets the unit or normalized Vector
Note that this does NOT alter the instance
Returns
| Vector —
unit Vector (magntiude = 1)
|
public function minus(v:Vector):Vector
Gets the difference of the instance and passed Vector
Note that this does NOT alter the instance
Parameters
| v:Vector — Vector to minusEquals from instance
|
Returns
| Vector —
difference of v from instance
|
public function minusEquals(v:Vector):void
Subtracts a Vector from the instance
Note that this alters the Vector
Parameters
| v:Vector — Vector to minusEquals
|
public function negate():void
public function normalize():void
Normalizes the Vector
Note that this alters the instance
public function plus(v:Vector):Vector
Gets the sum of the instance and passed Vector
Note that this does NOT alter the instance
Parameters
| v:Vector — Vector to add to instance
|
Returns
| Vector —
sum of v and instance
|
public function plusEquals(v:Vector):void
Adds a Vector to the instance
Note that this alters the instance
Parameters
public static function project(theta:Number, magnitude:Number):VectorParameters
| theta:Number |
| |
| magnitude:Number |
Returns
public function times(scalar:Number):Vector
Gets the product of the instance and passed scalar
Note that this does NOT alter the instance
Parameters
| scalar:Number — scalar by which to timesEquals
|
Returns
| Vector —
product of instance and scalar
|
public function timesEquals(scalar:Number):void
Multiplies the instance by a scalar
Note that this alters the Vector
Parameters
| scalar:Number — scalar by which to timesEquals
|