MathWorx

Class Line

Object
   |
   +--Line

class Line


The Line class defines a new object type for a line. It is in a sense a "point-slope" definition of a line. A Line has a base point and a direction, the direction being a unit vector. This is an effective way of defining a line in a way that does not limit it to any specific segment and allows for Affine Transformations to be applied.
Defined in Line.js

Requires:


Field Summary
 point3D base
          The "anchor" point.
 point3D direction
          The direction of the line; will be a unit vector.
<static>  Line x
          The x-axis.
<static>  Line y
          The y-axis.
<static>  Line z
          The z-axis.
 
Constructor Summary
Line(<Object> base, <Object> direction)
            The constructor function for a new Line.
 
Method Summary
 Boolean contains(point)
           Tests to see if a point lies on the line.
 Number distanceFrom(<Object> obj)
           Gets the distance between a line and another line, plane, or a point.
 Boolean equalTo(<Line> line)
           Tests two lines for equality.
 point3D intersection(<Object> obj)
           Finds the UNIQUE intersection of a line and another Line or Plane.
 Boolean intersects(<Object> obj)
           Tests if this line intersects with a given line or plane.
 Boolean isParallel(<Object> obj)
           Tests to see if a line is parallel to another line or plane.
 Boolean liesIn(<Plane> plane)
           Tests if a Line lies in a given Plane.
 point3D pointAt(<Number> t)
           Returns the point on the line at a given value of t.
 point3D pointClosestTo(<Object> obj)
           Finds the point on this line closest to a given line or point.
 Line reflectionIn(<Object> obj)
           Returns the line's reflection in the given point, line, or plane.
 Line rotate(<Number> deg, line)
           Rotates a line through an angle about an arbitrary line.
 String toString()
           Returns a string representation of the Line.
 Line translate(<Number> dx, <Number> dy, <Number> dz)
           Returns a new Line that is the old one translated by dx, dy, and dz.

Field Detail

base

point3D base

direction

point3D direction

x

<static> Line x

y

<static> Line y

z

<static> Line z

Constructor Detail

Line

Line(<Object> base, <Object> direction)

Method Detail

contains

Boolean contains(point)

distanceFrom

Number distanceFrom(<Object> obj)

equalTo

Boolean equalTo(<Line> line)

intersection

point3D intersection(<Object> obj)

intersects

Boolean intersects(<Object> obj)

isParallel

Boolean isParallel(<Object> obj)

liesIn

Boolean liesIn(<Plane> plane)

pointAt

point3D pointAt(<Number> t)

pointClosestTo

point3D pointClosestTo(<Object> obj)

reflectionIn

Line reflectionIn(<Object> obj)

rotate

Line rotate(<Number> deg, line)

toString

String toString()

translate

Line translate(<Number> dx, <Number> dy, <Number> dz)

MathWorx

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