Packageorg.un.flex.utils.geom
Interfacepublic interface IVector
ImplementorsComplexVector

Represents a generic vector in any geometry. We use this to define a vector in non-euclidean space Each vector is located at a given base (point) of type IPoint. For implementations where no information on the vector is available, its constructor must set itself to 0.
The implementation is a rewrite of Jens Kanschik's Hypergraph implementation in Java. However, apart from the general idea and some variable names, this code improves on hypergraph and also implements additional functionality. Copyright (C) 2003 Jens Kanschik, mail : jensKanschik



Public Properties
 PropertyDefined by
  base : IPoint
Returns the base (point) of the vector.
IVector
  dir : IPoint
[read-only] Returns the direction (point) of the vector.
IVector
Public Methods
 MethodDefined by
  
clone():Object
Creates a deep copy of the vector.
IVector
  
scale(f:Number):void
Scales the vector with the specified factor.
IVector
  
setTo(vector:IVector):void
Sets this vector to the given vector.
IVector
  
toString():String
Returns a String representation of the vector.
IVector
Property detail
baseproperty
base:IPoint  [read-write]

Returns the base (point) of the vector.

Implementation
    public function get base():IPoint
    public function set base(value:IPoint):void
dirproperty 
dir:IPoint  [read-only]

Returns the direction (point) of the vector.

Implementation
    public function get dir():IPoint
Method detail
clone()method
public function clone():Object

Creates a deep copy of the vector.

Returns
Object — A deep copy of the vector.
scale()method 
public function scale(f:Number):void

Scales the vector with the specified factor. This changes the length of the vector, but the base (point) is unchanged.

Parameters
f:Number — The scaling factor.
setTo()method 
public function setTo(vector:IVector):void

Sets this vector to the given vector. The specified vector must belong to the same model.

Parameters
vector:IVector — The new vector.
toString()method 
public function toString():String

Returns a String representation of the vector.

Returns
String — A String in appropriate format.