Pt2D 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

Pt2D

Usage

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

argm1 = the target point

Example:

->pt1 = Pt2D(100,100)

->pt2 = Pt2D(200,200)

->pt1.azi(pt2)

ans = 45.00000

->

See also (class function)

dist

| HOME | BACK |


AZIINTAZ

| HOME | BACK |

Purpose

To compute the intersection point by 2 azimuths. 

The unit of azimuths is in the same unit as the current angle mode, set by command "set angle".

Class

Pt2D

Usage

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

argm1 = azimuth from the 1st point(the calling point)

argm2 = the second point

argm3 = azimuth from the 2nd point

Example:

->pt_new = pt1.azintaz(45,pt2,270)

->

See also (class function)

distintdist

| HOME | BACK |


DIST

| HOME | BACK |

Purpose

To compute the distance to another point. 

Class

Pt2D

Usage

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

argm1 = the target point

Example:

->pt1 = Pt2D(100,100)

->pt2 = Pt2D(200,200)

->pt1.dist(pt2)

ans = 141.42136

->

See also (class function)

azi

| HOME | BACK |


DIST2LINE

| HOME | BACK |

Purpose

To compute the distance to a line, which is defined by two points.

Class

Pt2D

Usage

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

argm1 = first point of the line

argm2 = second point of the line

Example:

->pt1 = Pt2D(100,100)

->pt2 = Pt2D(200,200)

->pt3 = Pt2D(200,500)

->pt1.dist2line(pt2, pt3)

ans = 100.00000

->

See also (class function)

dist

| HOME | BACK |


DISTINTDIST

| HOME | BACK |

Purpose

To compute the intersection point by 2 distances. 

The last argument in the function is the flag, and must be given to indicate which of the two solutions is wanted.

By standing at point 1 (the calling point) looking toward point 2, if the solution point is on the left hand side, set the Flag to zero or a negative value.  If it is on the right hand side, set the flag to a positive number.

Class

Pt2D

Usage

{Pt2D} ret = object.DISTINTDIST({double} argm1,{Pt2D} argm2,{double} argm3,{int} argm4)

argm1 = distance from the 1st point(the calling point)

argm2 = the second point

argm3 = distance from the 2nd point

argm4 = solution flag

Example:

->pt_new = pt1.azintaz(45,pt2,270,-1)

->

See also (class function)

azintaz

| HOME | BACK |


INIT

| HOME | BACK |

Purpose

To initialize a Pt2D point object.

Class

Pt2D

Usage

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

argm1 = x coordinate

argm2 = y coordinate

Example:

->pt1 = Pt2D()

->pt1.init(100,200)

->print pt1

( 100.000 , 200.000)

->

See also (class function)

x, y

| HOME | BACK |


IS_INWINDOW

| HOME | BACK |

Purpose

To check whether a point, the calling object, is within a window, defined by two points representing lower left and upper right corners of the window.

Class

Pt2D

Usage

{bool} ret = object.IS_INWINDOW({Pt2D} argm1,{Pt2D} argm2)

argm1 = lower left corner of the window

argm2 = upper right corner of the window

Example:

->pt1 = Pt2D(100,100)

->pt2 = Pt2D(200,200)

->pt3 = Pt2D(200,500)

->pt3.is_inwindow(pt1, pt2)

ans = 0

->

See also (class function)

x, y

| 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 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 and y 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

Pt2D

Usage

{bool} ret = object.IS_NA()

Example:

->pt3 = Pt2D(200,500)

->pt3.is_na()

ans = 0

->

See also (class function)

 

| HOME | BACK |


LNGETX

| HOME | BACK |

Purpose

To get an X coordinate of a line at a specific y coordinate, specified by the user.

The line is defined by the calling point and another point, specified by the user.

Class

Pt2D

Usage

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

argm1 = another end point of the line

argm2 = y coordinate, at which the value of x coordinate being wanted

Example:

->pt1 = Pt2D(100,100)

->pt2 = Pt2D(200,200)

->pt1.lngetx(pt2,50)

ans = 50.00000

->

See also (class function)

lngety

| HOME | BACK |


LNGETY

| HOME | BACK |

Purpose

To get an Y coordinate of a line at a specific x coordinate, specified by the user.

The line is defined by the calling point and another point, specified by the user.

Class

Pt2D

Usage

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

argm1 = another end point of the line

argm2 = x coordinate, at which the value of y coordinate being wanted

Example:

->pt1 = Pt2D(100,100)

->pt2 = Pt2D(200,200)

->pt1.lngety(pt2,50)

ans = 50.00000

->

See also (class function)

lngetx

| HOME | BACK |


LNINTCIR

| HOME | BACK |

Purpose

To compute the intersection a line and a circle.  The line is defined by the calling point and another point specified in the function.

The last argument in the function is the flag, and must be given to indicate which of the two solutions is wanted.

If the closer solution point, from the calling point, is wanted, set the Flag to zero or a negative value.  If farther point is wanted, set the flag to a positive number.

Class

Pt2D

Usage

{Pt2D} ret = object.LNINTCIR({Pt2D} argm1,{Pt2D} argm2,{double} argm3,{int} argm4)

argm1 = The 2nd point of the line

argm2 = center of the circle

argm3 = radius of the circle

argm4 = solution flag

Example:

->pt_new = pt1.lnintcir(pt2, pt3,45,-1)

->

See also (class function)

lnintln

| HOME | BACK |


LNINTLN

| HOME | BACK |

Purpose

To calculate an intersection point of two lines.

The two lines are defined by four points, one of which is the calling point object itself.

Class

Pt2D

Usage

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

argm1 = second point of the first line

argm2 = first point of the second line

argm3 = second point of the second line

Example:

->pt1 = Pt2D(100,100)

->pt2 = Pt2D(200,200)

->pt3 = Pt2D(200,100)

->pt4 = Pt2D(100,200)

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

ans = ( 150.000 , 150.000)

->

See also (class function)

dist2line

| HOME | BACK |


MATRIX

| HOME | BACK |

Purpose

To convert to a Matrix object.

Class

Pt2D

Usage

{Matrix} ret = object.MATRIX()

Example:

->pt1 = Pt2D(100,100)

->print pt1

( 100.000 , 100.000)

->M = pt1.matrix()

->M

ans =

no of row : 2
no of column : 1

0: 100.00000
1: 100.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

Pt2D

Usage

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

argm1 = second point of the line

Example:

->pt1 = Pt2D(100,100)

->pt2 = Pt2D(200,200)

->pt1.midpoint(pt2)

ans = ( 150.000 , 150.000)

->

See also (class function)

lnintln

| HOME | BACK |


PERP2LINE

| HOME | BACK |

Purpose

To compute the intersection of a line, drawing perpendicularly to another line from the calling point.

Class

Pt2D

Usage

{Pt2D} ret = object.PERP2LINE({Pt2D} argm1,{Pt2D} argm2)

argm1 = The 1st point of the line

argm2 = The 2nd point of the line

Example:

->pt_new = pt1.perp2line(pt2, pt3)

->

See also (class function)

lnintln

| HOME | BACK |


SHIFT

| HOME | BACK |

Purpose

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

Class

Pt2D

Usage

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

argm1 = shift in x direction  ( positive = right, negative = left)

argm2 = shift in y direction  ( positive = up   , negative = down)

Example:

->pt1 = Pt2D(100,100)

->pt1.shift(50,100)

ans = ( 150.000 , 200.000)

->

See also (class function)

traverse

| HOME | BACK |


SLOPE

| HOME | BACK |

Purpose

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

Slope is a ratio between difference in y coordinates and difference in x coordinates of two points on the line.

Class

Pt2D

Usage

{double} ret = object.SLOPE({Pt2D} argm1)

argm1 = second point of the line

Example:

->pt1 = Pt2D(100,100)

->pt2 = Pt2D(200,200)

->pt1.slope(pt2)

ans = 1.00000

->

See also (class function)

lngetx, lngety

| HOME | BACK |


TRAVERSE

| HOME | BACK |

Purpose

To shift a point in a specific azimuth with a given distance.

The unit of azimuth is that of the current unit set by command "set angle".

Class

Pt2D

Usage

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

argm1 = azimuth

argm2 = distance

Example:

->pt1 = Pt2D(100,100)

->pt1.traverse(45,100)

ans = ( 170.711 , 170.711)

->

See also (class function)

shift

| HOME | BACK |


X

| HOME | BACK |

Purpose

To report the current x coordinate of the point object.

Class

Pt2D

Usage

{double} ret = object.X()

Example:

->pt1 = Pt2D(100,200)

->pt1.x()

ans =   100.00000

->

See also (class function)

y

| HOME | BACK |


Y

| HOME | BACK |

Purpose

To report the current y coordinate of the point object.

Class

Pt2D

Usage

{double} ret = object.Y()

Example:

->pt1 = Pt2D(100,200)

->pt1.y()

ans =   200.00000

->

See also (class function)

x

| HOME | BACK |


YC

| HOME | BACK |

Purpose

To calculate the Y-intercept of a line, defined by the calling point and another point.

Y-intercept is the y coordinate at which a line is intersected with the Y axis.

 

Class

Pt2D

Usage

{double} ret = object.YC({Pt2D} argm1)

argm1 = second point of the line

Example:

->pt1 = Pt2D(100,100)

->pt2 = Pt2D(200,200)

->pt1.slope(pt2)

ans = 0.00000

->

See also (class function)

lngetx, lngety

| HOME | BACK |