Dataplot Vol 2 Vol 1

# PERPINDICULAR LINES

Name:
PERPINDICULAR LINES
Type:
LET Subcommand
Purpose:
Given a line defined by two points and a third point, find the line perpindicular to the first line and containing the third point.
Syntax:
LET <yout> <xout>= PERPINDICULAR LINES <x1> <y1> <x2> <y2> <x3> <y3>
<SUBSET/EXPCEPT/FOR qualification>
where <x1> is a variable or parameter containing the x-coordinates for the first point of line one;
<y1> is a variable or parameter containing the y-coordinates for the first point of line one;
<x2> is a variable or parameter containing the x-coordinates for the second point of line one;
<y2> is a variable or parameter containing the y-coordinates for the second point of line one;
<x3> is a variable or parameter containing the x-coordinates for the third point;
<y3> is a variable or parameter containing the y-coordinates for the third point;
<yout> is a variable containing the y-coordinates of the second point of the perpindicular line;
<xout> is a variable containing the x-coordinates of the second point of the perpindicular line;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
LET YOUT XOUT = PERPINDICULAR LINES X1 Y1 X2 Y2 X3 Y3 X4 Y4
Default:
None
Synonyms:
None
Related Commands:
 PARALLEL LINE = Determine the coordinates for a point that defines a parallel line determined by a point and a line defined by two points. ANGRAD = Return the counter clockwise angle, in radians, of the angle determined by three points. DPNTLINE = Compute the perpindicular distance between a point and a line defined by a point and a slope. POINTS IN POLYGON = Determine whether points are in the interior of a convex polygon. CONVEX HULL = Determine the convex hull of a set of points. TRANSFORM POINTS = Perform location, scale, and rotation transformation for a set of points. EXTREME POINTS = Determine the extreme points of a set of points. LINE INTERSECTIONS = Determine the intersection points for a set of lines.
Applications:
Computational Geometry
Implementation Date:
2012/10
Program:
```
dimension 40 columns
skip 25
read convhull.dat x y
.
let y2 x2 = 2d convex hull y x
let xtemp = x2(1)
let ytemp = y2(1)
let y2 = combine y2 ytemp
let x2 = combine x2 xtemp
let x3 = x2
let y3 = y2
let n = size y2
let nm1 = n - 1
retain x2 y2 for i = 1 1 nm1
retain x3 y3 for i = 2 1 n
let slope = slope(x2,y2,x3,y3)
let pdist = dpntline(xtemp,ytemp,x3,y3,slope)
let xtempv = xtemp for i = 1 1 nm1
let ytempv = ytemp for i = 1 1 nm1
let y5 x5 = perpindicular line x2 y2 x3 y3 xtempv ytempv
.
set write decimals 4
print "Anchor Point: (^xtemp,^ytemp)"
print " "
print " "
print x2 y2 x3 y3 x5 y5
```
The following output is generated
```
Anchor Point: (0,-2.)

------------------------------------------------------------------------------------------
X2             Y2             X3             Y3             X5             Y5
------------------------------------------------------------------------------------------
0.0000        -2.0000         1.0000        -1.7300         0.0000        -2.0000
1.0000        -1.7300         1.7300        -1.0000         1.0000        -1.7300
1.7300        -1.0000         2.0000         0.0000         1.7300        -1.0000
2.0000         0.0000         1.7300         1.0000         2.0000         0.0000
1.7300         1.0000         1.0000         1.7300         1.7300         1.0000
1.0000         1.7300         0.0000         2.0000         1.0000         1.7300
0.0000         2.0000        -1.0000         1.7300         0.0000         2.0000
-1.0000         1.7300        -1.7300         1.0000        -1.0000         1.7300
-1.7300         1.0000        -2.0000         0.0000        -1.7300         1.0000
-2.0000         0.0000        -1.7300        -1.0000        -2.0000         0.0000
-1.7300        -1.0000        -1.0000        -1.7300        -1.7300        -1.0000
-1.0000        -1.7300         0.0000        -2.0000        -1.0000        -1.7300
```

Date created: 02/15/2013
Last updated: 02/15/2013
Please email comments on this WWW page to alan.heckert@nist.gov.