Pt3D Class Function Manual


AZI

| HOME | BACK |

Purpose

To compute azimuth angle to another point.  The return azimuth is in the same unit as the current angle mode, set by command "set angle".

An azimuth is an angle, at the calling point object, measured clockwise from the north to the target point.

Class

Pt3D

Usage

{double} ret = object.AZI({Pt3D} argm1)

argm1 = the target point

Example:

->pt1 = Pt2D(100,200,300)

->pt2 = Pt2D(300,400,300)

->pt1.azi(pt2)

ans = 45.00000

->

See also (class function)

dist

| HOME | BACK |


DIST

| HOME | BACK |

Purpose

To compute the distance to another point in 3D space.

Class

Pt3D

Usage

{double} ret = object.DIST({Pt3D} argm1)

argm1 = the target point

Example:

->pt1 = Pt3D(100,200,300)

->pt2 = Pt3D(300,400,300)

->pt1.dist(pt2)

ans = 282.84271

->

See also (class function)

azi

| HOME | BACK |


DIST2LINE

| HOME | BACK |

Purpose

To compute the distance to a line, which is defined by two points in 3D space.

Class

Pt3D

Usage

{double} ret = object.DIST2LINE({Pt3D} argm1,{Pt3D} argm2)

argm1 = first point of the line

argm2 = second point of the line

Example:

->pt1 = Pt3D(100,200,300)

->pt2 = Pt3D(300,400,300)

->pt3 = Pt3D(0,70,95)

->pt3.dist2line(pt1, pt2)

ans = 206.09464

->

See also (class function)

dist2plane

| HOME | BACK |


DIST2PLANE

| HOME | BACK |

Purpose

To compute the distance to a plane, which is defined by three points in 3D space.

Class

Pt3D

Usage

{double} ret = object.DIST2LINE({Pt3D} argm1,{Pt3D} argm2,{Pt3D} argm3)

argm1 = first point of the plane

argm2 = second point of the plane

argm3 = third point of the plane

Example:

->pt1 = Pt3D(100,200,300)

->pt2 = Pt3D(300,400,300)

->pt3 = Pt3D(0,70,95)

->pt4 = Pt3D(100,700,905)

->pt4.dist2plane(pt1, pt2, pt3)

ans = 289.40324

->

See also (class function)

dist2line

| HOME | BACK |


INIT

| HOME | BACK |

Purpose

To initialize a Pt3D point object.

Class

Pt3D

Usage

{void} object.INIT({double} argm1,{double} argm2,{double} argm3)

argm1 = x coordinate

argm2 = y coordinate

argm2 = z coordinate

Example:

->pt1 = Pt3D()

->pt1.init(100,200,300)

->print pt1

( 100.000 , 200.000 , 300.000)

->

See also (class function)

x, y, z

| HOME | BACK |


IS_NA

| HOME | BACK |

Purpose

To check whether a point, the calling object, is a "na" point.  An "na", not applicable point, is a point whose x y z coordinates are equal to value of "na", a system variable whose value can be set by command set na.

For example, if value of the current system variable "na" = -999.000, an "na" point will have its x y and z coordinates = -999.000.  This kind of point is got when a COGO function can not be performed successfully, for example finding an intersection that does not exist, etc.

Class

Pt3D

Usage

{bool} ret = object.IS_NA()

Example:

->pt1 = Pt3D(10,20,30)

->pt1.is_na()

ans = 0

->

See also (class function)

 

| HOME | BACK |


MATRIX

| HOME | BACK |

Purpose

To convert to a Matrix object.

Class

Pt3D

Usage

{Matrix} ret = object.MATRIX()

Example:

->pt1 = Pt3D(100,200,300)

->M = pt1.matrix()

->M

ans =

no of row    : 3
no of column : 1

 0: 100.00000
 1: 200.00000
 2: 300.00000

->

See also (class function)

init

| HOME | BACK |


MIDPOINT

| HOME | BACK |

Purpose

To calculate the middle point of a line, defined by the calling point and another point.

Class

Pt3D

Usage

{Pt3D} ret = object.MIDPOINT({Pt3D} argm1)

argm1 = second point of the line

Example:

->pt1 = Pt3D(100,200,300)

->pt2 = Pt3D(300,400,300)

->pt1.midpoint(pt2)

ans = ( 200.000 , 300.000 , 300.000)

->

See also (class function)

shift

| HOME | BACK |


PABCD

| HOME | BACK |

Purpose

To calculate the plane parameters, A, B, C, D, of a plane, defined by the calling point and two other points.

The plane equation is defined as Ax + By + Cz + D = 0, where x, y, z is coordinate of a point on the plane.

The return result is a matrix, in which the first element is A, the second one is B, and so on.

Class

Pt3D

Usage

{Matrix} ret = object.PABCD({Pt3D} argm1,{Pt3D} argm2)

argm1 = second point of the plane

argm2 = third point of the plane

Example:

->pt1 = Pt3D(100,200,300)

->pt2 = Pt3D(300,400,300)

->pt3 = Pt3D(0,70,95)

->M = pt1.pabcd(pt2, pt3)

->M

ans =

no of row : 4
no of column : 1

0: 41000.00000
1: -41000.00000
2: 6000.00000
3: 2300000.00000

->

See also (class function)

dist2plane

| HOME | BACK |


SHIFT

| HOME | BACK |

Purpose

To shift a point by a specific amounts of x y and z coordinate.

Class

Pt3D

Usage

{Pt2D} ret = object.SHIFT({double} argm1,{double} argm2,{double} argm3)

argm1 = shift in x direction 

argm2 = shift in y direction 

argm3 = shift in z direction 

Example:

->pt1 = Pt3D(100,200,300)

->pt1.shift(10,20,30)

ans = ( 110.000 , 220.000 , 330.000)

->

See also (class function)

 

| HOME | BACK |


X

| HOME | BACK |

Purpose

To report the current x coordinate of the point object.

Class

Pt3D

Usage

{double} ret = object.X()

Example:

->pt1 = Pt3D(100,200,300)

->pt1.x()

ans =   100.00000

->

See also (class function)

y, z

| HOME | BACK |


Y

| HOME | BACK |

Purpose

To report the current y coordinate of the point object.

Class

Pt3D

Usage

{double} ret = object.Y()

Example:

->pt1 = Pt3D(100,200,300)

->pt1.y()

ans =   200.00000

->

See also (class function)

x, z

| HOME | BACK |


Z

| HOME | BACK |

Purpose

To report the current z coordinate of the point object.

Class

Pt3D

Usage

{double} ret = object.Z()

Example:

->pt1 = Pt3D(100,200,300)

->pt1.z()

ans =   300.00000

->

See also (class function)

x, y

| HOME | BACK |