Packageorg.un.flex.utils.geom
Classpublic class ComplexVector
ImplementsIVector

This is an implementation of the interface IVector for the complex plane, i.e. the base point is a complex number. Since the set of complex numbers is a real vector space, the direction is a complex number as well.
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.
ComplexVector
  dir : IPoint
[read-only] Returns the direction (point) of the vector.
ComplexVector
Public Methods
 MethodDefined by
  
ComplexVector(base:ComplexNumber = null, dir:ComplexNumber = null)
Constructor of ComplexVector
ComplexVector
  
clone():Object
Creates a deep copy of the vector.
ComplexVector
  
scale(r:Number):void
Scales the vector with the specified factor.
ComplexVector
  
setTo(v:IVector):void
Sets this vector to the given vector.
ComplexVector
  
toString():String
Returns a String representation of the vector.
ComplexVector
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
Constructor detail
ComplexVector()constructor
public function ComplexVector(base:ComplexNumber = null, dir:ComplexNumber = null)

Constructor of ComplexVector

Parameters
base:ComplexNumber (default = null) — The base of the vector
 
dir:ComplexNumber (default = null) — The direction of the vector
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(r:Number):void

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

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

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

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

Returns a String representation of the vector.

Returns
String — A String in appropriate format.