# Point3d

Kind of class: | public class |
---|---|

Package: | org.casalib.math.geom |

Inherits from: | none |

Version: | 09/23/08 |

Author: | Aaron Clinger, David Bliss, Mike Creighton |

Classpath: | org.casalib.math.geom.Point3d |

File last modified: | Thursday, 19 February 2009, 11:33:36 |

Stores location of a point in a three-dimensional coordinate system, where x represents the horizontal axis, y represents the vertical axis, z represents the axis that is vertically perpendicular to the x/y axis or depth.

## Summary

Constructor

- Point3d (x:Number = 0, y:Number = 0, z:Number = 0)
- Creates a new Point3d.

Instance properties

Class methods

- distance (firstPoint:Point3d) : Number
- Determines the distance between the first and second points in 3D space.

- interpolate (firstPoint:Point3d) : Point3d
- Determines a point between two specified points.

Instance methods

- add (point:Point3d) : Point3d
- Adds the coordinates of another Point3d to the coordinates of this point to create a new Point3d.

- subtract (point:Point3d) : Point3d
- Subtracts the coordinates of another Point3d from the coordinates of this point to create a new Point3d.

- offset (xOffset:Number, yOffset:Number, zOffset:Number) : void
- Offsets the Point object by the specified amount.

- equals (point:Point3d) : Boolean
- Determines if the point specified in the point parameter is equal to this point object.

- clone : Point3d
- Creates a copy of this Point3d object.

## Constructor

### Point3d

public function

**Point3d**(x:Number = 0,
y:Number = 0,
z:Number = 0)

Creates a new Point3d.

Parameters:

x:

The horizontal coordinate of the point.

y:

The vertical coordinate of the point.

z:

The depth coordinate of the point.

## Instance properties

### x

public

**x**:Number(read,write)

The horizontal coordinate of the point.

### y

public

**y**:Number(read,write)

The vertical coordinate of the point.

### z

public

**z**:Number(read,write)

The depth coordinate of the point.

## Class methods

### distance

Determines the distance between the first and second points in 3D space.

Parameters:

firstPoint :

The first Point3d.

secondPoint:

The second Point3d.

Returns:

- Distance between the two points.

### interpolate

Determines a point between two specified points.

Parameters:

firstPoint :

The first Point3d.

secondPoint:

The second Point3d.

amount :

The level of interpolation between the two points. If

`0%`

, `firstPoint`

is returned; if `100%`

, `secondPoint`

is returned.Returns:

- The new, interpolated point.

## Instance methods

### add

Adds the coordinates of another Point3d to the coordinates of this point to create a new Point3d.

Parameters:

point:

The point to be added.

Returns:

- The new point.

### clone

Creates a copy of this Point3d object.

Returns:

- A new Point3d with the same values as this point.

### equals

Determines if the point specified in the

`point`

parameter is equal to this point object. Parameters:

point:

A Point3d object.

Returns:

- Returns
`true`

if shape's location is identical; otherwise`false`

.

### offset

public function

**offset**(xOffset:Number,
yOffset:Number,
zOffset:Number) : void

Offsets the Point object by the specified amount.

Parameters:

xOffset:

The amount by which to offset the horizontal coordinate.

yOffset:

The amount by which to offset the vertical coordinate.

zOffset:

The amount by which to offset the depth coordinate.