Calculate A Vector From Two Points - Autodesk AUTOCAD 2006 Command Reference Manual

Table of Contents

Advertisement

Numeric functions
Function
abs(real)
round(real)
trunc(real)
r2d(angle)
d2r(angle)
pi

Calculate a Vector from Two Points

The functions vec and vec1 calculate a vector from two points.
vec(p1,p2)
Provides the vector from point p1 to point p2.
vec1(p1,p2)
Provides the unit vector from point p1 to point p2.
The following example uses CAL to move selected objects 3 units in the
direction from the center of one selected circle to the center of another selected
circle:
Command: move
Select objects
Specify base point or displacement: 'cal
>> Expression: 3*vec1(cen,cen)
Select entity for CEN snap: Specify a circle or an arc
Specify second point of displacement or <use first point as displacement>: Specify
a point or press
The following examples illustrate the meaning of vector and point calculations.
Examples of vector and point calculations
Expression
vec(a,b)
Description
Absolute value of the number
Number rounded to the nearest integer
Integer portion of the number
Angles in radians converted to degrees; for example, r2d(pi) converts
the pi radians to 180 degrees
Angles in degrees converted to radians; for example, d2r(180) converts
180 degrees to radians and returns the value of pi
The constant pi
ENTER
Meaning
Determines vector translation from point a to point b.
Calculate a Vector from Two Points | 195

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents