Ang2Vec Math - Vectors 
MiniCAD

VectorScript Declaration:

FUNCTION   Ang2Vec
(   angleR :REAL;
    Length :REAL
) :VECTOR ;

Python:

def  vs.Ang2Vec(angleR, Length):
   return VECTOR

Description:

Returns a 3-dimensional vector that is defined by the specified polar angle and length values.

説明

指定した角度と距離を2次元のベクトルに変換して返します。

Parameters:

angleR The angle of the vector (in degrees). 角度
Length The length of the vector. 距離

Result:

Returns a 3-dimensional vector.

返り値

2次元のベクトルを返します。



  AngBVec Math - Vectors 
MiniCAD

VectorScript Declaration:

FUNCTION   AngBVec
(   v1 :VECTOR;
    v2 :VECTOR
) :REAL ;

Python:

def  vs.AngBVec(v1, v2):
   return REAL

Description:

Returns the positive angle between the two specified vectors, in the range of 0~180 degrees.

When used with 3D vectors, the angle returned will be in a plane defined by the two vectors.

説明

2つのベクトルがなす角(0~180度)を返します。

Parameters:

v1 First vector to be compared. ベクトル1
v2 Second vector to be compared. ベクトル2

Result:

Returns a REAL value which is the angle (in degrees) between the two vectors.

返り値

2つのベクトルがなす角(度数)をREAL型の値で返します。

Example:

PROCEDURE Example;
VAR
	pt1, pt2, pt3, pt4 :VECTOR;
BEGIN
	GetPt(pt1.x, pt1.y);
	GetPtL(pt1.x, pt1.y, pt2.x, pt2.y);
	GetPtL(pt2.x, pt2.y, pt3.x, pt3.y);
	MoveTo(pt1.x, pt1.y);
	LineTo(pt2.x, pt2.y);
	LineTo(pt3.x, pt3.y);
	pt4 := (pt1 + pt3) / 2;
	TextOrigin(pt4.x, pt4.y);
	CreateText(Concat(AngBVec(pt1 - pt2, pt3 - pt2)));
END;
RUN(Example);



  Comp Math - Vectors 
MiniCAD

VectorScript Declaration:

PROCEDURE   Comp
(   v1 :VECTOR;
    v2 :VECTOR;
  VAR  v3 :VECTOR;
  VAR  v4 :VECTOR
) ;

Python:

def  vs.Comp(v1, v2, v3, v4):
   return (v3, v4)

Description:

Returns the components of a comparison of two vectors.

The vector component of v1 along v2 in v3, and the vector component of v1 orthogonal to v2 in v4.

説明

v3にはv1のv2方向成分、v4にはv1のv2に直角方向の成分を返します。

Parameters:

v1 Comparison vector 1. ベクトル1
v2 Comparison vector 2 ベクトル2
v3 Component of vector 1 along vector 2 ベクトル3
v4 Component of vector 1 orthogonal to vector 2. ベクトル4



  CrossProduct Math - Vectors 
VectorWorks8.5

VectorScript Declaration:

FUNCTION   CrossProduct
(   v1 :VECTOR;
    v2 :VECTOR
) :VECTOR ;

Python:

def  vs.CrossProduct(v1, v2):
   return VECTOR

Description:

Returns the cross product of the two specified vectors.

The cross product is also known as the vector product of the two vectors. The result is a vector whose magnitude is equivalent to the product of the magnitudes of the two vectors multiplied by the sine of the smaller angle between the two vectors. The direction of the resultant vector is perpendicular to a plane formed by the two source vectors.

説明

指定した2つのベクトルの外積を返します。

Parameters:

v1 Source vector 1. ベクトル1
v2 Source vector 2. ベクトル2

Result:

Returns a VECTOR which is the cross product of v1 and v2.

返り値

指定した2つのベクトルの外積を返します。



  DotProduct Math - Vectors 
VectorWorks8.0

VectorScript Declaration:

FUNCTION   DotProduct
(   v1 :VECTOR;
    v2 :VECTOR
) :REAL ;

Python:

def  vs.DotProduct(v1, v2):
   return REAL

Description:

Returns the dot product of the two specified vectors.

The dot product is also known as the scalar product of the two vectors, and is equivalent to the product of the magnitudes of the two vectors multiplied by the cosine of the angle between the two vectors.

説明

指定した2つのベクトルの内積を返します。

Parameters:

v1 Source vector 1. ベクトル1
v2 Source vector 2. ベクトル2

Result:

Returns the scalar, or dot, product of the vectors v1 and v2.

返り値

第1ベクトルと第2ベクトルの積を返します。

Example:

PROCEDURE Example;
VAR
	pt1, pt2, pt3, pt4 :VECTOR;
	ang :REAL;
BEGIN
	GetPt(pt1.x, pt1.y);
	GetPtL(pt1.x, pt1.y, pt2.x, pt2.y);
	GetPtL(pt2.x, pt2.y, pt3.x, pt3.y);
	MoveTo(pt1.x, pt1.y);
	LineTo(pt2.x, pt2.y);
	LineTo(pt3.x, pt3.y);
	pt4 := (pt1 + pt3) / 2;
	{Find the angle between the vectors.}
	ang := Rad2Deg(ArcCos(DotProduct(UnitVec(pt1-pt2), UnitVec(pt3-pt2))));
	TextOrigin(pt4.x, pt4.y);
	CreateText(Concat(ang));
END;
RUN(Example);

See Also:

AngBVec  



  Norm Math - Vectors 
MiniCAD

VectorScript Declaration:

FUNCTION   Norm
( Vec:VECTOR ) :REAL ;

Python:

def  vs.Norm(Vec):
   return REAL

Description:

Returns the length, or magnitude, of the specified vector.

説明

指定したベクトルの長さを返します。

Parameters:

Vec Vector to be measured. ベクトル

Result:

A REAL value which is the length of the vector.

返り値

ベクトルの長さを返します。

Example:

PROCEDURE Example;
VAR
	vec :VECTOR;
BEGIN
	vec.x := 1;
	vec.y := 1.732050807;
	Message(Norm(vec));
END;
RUN(Example);

See Also:

Distance  



  Perp Math - Vectors 
MiniCAD

VectorScript Declaration:

FUNCTION   Perp
( Vec:VECTOR ) :VECTOR ;

Python:

def  vs.Perp(Vec):
   return VECTOR

Description:

Returns a vector which is perpendicular to the specified vector. The resultant vector will have the same magnitude as the source vector, and their scalar product will be zero. The direction of the return vector will equal Vec2Ang(Vec) - 90.

説明

指定されたベクトルに垂直なベクトルを返します。返されるベクトルの大きさは指定したベクトルと同じで、それらの内積は0になります。返されるベクトルの角度はVec2Ang(Vec) - 90と等しくなります。

Parameters:

Vec Source vector. ベクトル

Result:

Returns a VECTOR.

返り値

ベクトルの長さを返します。



  UnitVec Math - Vectors 
MiniCAD

VectorScript Declaration:

FUNCTION   UnitVec
( Vect:VECTOR ) :VECTOR ;

Python:

def  vs.UnitVec(Vect):
   return VECTOR

Description:

Returns the standard unit vector of the specified vector.

説明

指定したベクトルの標準単位ベクトルを返します。

Parameters:

Vect Source vector. ベクトル

Result:

Returns a VECTOR.

返り値

ベクトルを返します。



  Vec2Ang Math - Vectors 
MiniCAD

VectorScript Declaration:

FUNCTION   Vec2Ang
( Vect:VECTOR ) :REAL ;

Python:

def  vs.Vec2Ang(Vect):
   return REAL

Description:

Returns the angle, in degrees, of the specified vector. If Vect is a 3D vector, Vec2Ang will return the 3D angle between Vect and the X axis. If Vect is {0,0,0}, Vec2Ang returns -90.

説明

指定したベクトルの角度(度数)を返します。Vectが3Dベクトルの場合、VectとX軸の間の角度を返します。Vectが{0,0,0}の場合、-90が返されます。

Parameters:

Vect Source vector. ベクトル

Result:

Returns the angle of the specified vector in degrees.

返り値

指定したベクトルの角度(度数)を返します。