MathWorx

Class point2D

Object
   |
   +--Vector
         |
         +--point2D

class point2D
extends Vector


The point2D class defines a point in 2-dimensional Euclidean space via homogeneous coordinates (i.e. as a 3-vector (x,y,1)). This allows affine transformations to be applied to 2-D points via matrix multiplication.
Defined in point2D.js

Requires:


Field Summary
 Array components
          The components of the 2D point.
 <final> Integer n
          The "dimension" of the point; ALWAYS 2.
 Number x
          The x value of the 2D point.
 Number y
          The y value of the 2D point.
<static>  Object zero
          
   
Fields inherited from class Vector
components, n
 
Constructor Summary
point2D(<Number> x, <Number> y)
            Constructor function.
 
Method Summary
 point3D make3D()
           Converts a 2D point to a 3D point with a 0 z-component.
 point2D map(func)
           Maps this point to a new 2D point according to a given function.
 point2D rotate(<Number> theta)
           Rotates a point through a degree theta and returns a new point.
 String toString()
           Produces a string representation of the point.
 Vector toVector()
           Converts point2D object back to a Vector.
 point2D translate(<Number> dx, <Number> dy)
           Translates a point (x,y,1) to (x+dx, y+dy, 1).
 
Methods inherited from class Vector
get, toEach, equalTo, normalize, linearlyIndependent, linearlyDependent, add, subtract, round, multiplyBy, dot, cross, resolute, reflectionIn, negative, toColumnMatrix, toRowMatrix, getLength, angleBetween, isParallel, isAntiParallel, isPerpendicular, distanceFrom, dimension, snapTo, indexOf, max, elements, addElement, toPoint
 

Field Detail

components

Array components

n

<final> Integer n

x

Number x

y

Number y

zero

<static> Object zero

Constructor Detail

point2D

point2D(<Number> x, <Number> y)

Method Detail

make3D

point3D make3D()

map

point2D map(func)

rotate

point2D rotate(<Number> theta)

toString

String toString()

toVector

Vector toVector()

translate

point2D translate(<Number> dx, <Number> dy)

MathWorx

Documentation generated by JSDoc on Mon Aug 11 13:58:31 2008