Packageorg.generalrelativity.foam.math
Classpublic class Vector



Public Properties
 PropertyDefined by
  magnitude : Number
[read-only] Gets the magnitude of the instance
Vector
  x : Number
Vector
  y : Number
Vector
Public Methods
 MethodDefined by
  
Vector(x:Number = 0, y:Number = 0)
Constructor
Vector
  
Returns a Vector identical to the instance
Vector
  
cross(v:Vector):Number
Gets the cross product of the Vector and instance
Vector
  
crossScalar(scalar:Number):Vector
Vector
  
dividedBy(scalar:Number):Vector
Gets the quotient of the instance and passed scalar Note that this does NOT alter the instance
Vector
  
dividedByEquals(scalar:Number):void
Divides the instance by a scalar Note that this alters the Vector
Vector
  
dot(v:Vector):Number
Gets the dot product of the Vector and instance
Vector
  
getAngle(v:Vector):Number
Vector
  
Vector
  
Gets the unit or normalized Vector Note that this does NOT alter the instance
Vector
  
Gets the difference of the instance and passed Vector Note that this does NOT alter the instance
Vector
  
Subtracts a Vector from the instance Note that this alters the Vector
Vector
  
negate():void
Vector
  
normalize():void
Normalizes the Vector Note that this alters the instance
Vector
  
Gets the sum of the instance and passed Vector Note that this does NOT alter the instance
Vector
  
Adds a Vector to the instance Note that this alters the instance
Vector
  
project(theta:Number, magnitude:Number):Vector
[static]
Vector
  
times(scalar:Number):Vector
Gets the product of the instance and passed scalar Note that this does NOT alter the instance
Vector
  
timesEquals(scalar:Number):void
Multiplies the instance by a scalar Note that this alters the Vector
Vector
Property detail
magnitudeproperty
magnitude:Number  [read-only]

Gets the magnitude of the instance

Implementation
    public function get magnitude():Number
xproperty 
public var x:Number
yproperty 
public var y:Number
Constructor detail
Vector()constructor
public function Vector(x:Number = 0, y:Number = 0)

Constructor

Parameters
x:Number (default = 0) — defines {
 
y:Number (default = 0) — defines {
Method detail
clone()method
public function clone():Vector

Returns a Vector identical to the instance

Returns
Vector
cross()method 
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
crossScalar()method 
public function crossScalar(scalar:Number):VectorParameters
scalar:Number

Returns
Vector
dividedBy()method 
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
dividedByEquals()method 
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
dot()method 
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
getAngle()method 
public function getAngle(v:Vector):NumberParameters
v:Vector

Returns
Number
getPerp()method 
public function getPerp():Vector

Returns
Vector
getUnit()method 
public function getUnit():Vector

Gets the unit or normalized Vector Note that this does NOT alter the instance

Returns
Vector — unit Vector (magntiude = 1)
minus()method 
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
minusEquals()method 
public function minusEquals(v:Vector):void

Subtracts a Vector from the instance Note that this alters the Vector

Parameters
v:Vector — Vector to minusEquals
negate()method 
public function negate():void
normalize()method 
public function normalize():void

Normalizes the Vector Note that this alters the instance

plus()method 
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
plusEquals()method 
public function plusEquals(v:Vector):void

Adds a Vector to the instance Note that this alters the instance

Parameters
v:Vector — Vector to add
project()method 
public static function project(theta:Number, magnitude:Number):VectorParameters
theta:Number
 
magnitude:Number

Returns
Vector
times()method 
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
timesEquals()method 
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