Vector API/de

From FreeCAD Documentation
Jump to navigation Jump to search
This page is a translated version of the page Vector API and the translation is 20% complete.
Outdated translations are marked like this.
Other languages:
Deutsch • ‎English • ‎español • ‎français • ‎italiano • ‎română
(November 2018) Diese Information kann unvollständig und veraltet sein. Für die letzte API siehe die (engl.) autogenerierte API-Dokumentation.


Vektoren werden überall in FreeCAD benutzt.

Vectors are used everywhere in FreeCAD.

Beispiel:

v=FreeCAD.Vector()
v=FreeCAD.Vector(1,0,0)
v=FreeCAD.Base.Vector()
v2 = FreeCAD.Vector(3,2,-5)
v3 = v.add(v2)
print v3.Length
Property.png Length

Returns: returns the length of the vector.

Method.png add(Vector)

Description: adds another vector to this one.

Returns: vector

Method.png cross(Vector)

Description: the crossproduct between this vector and another.

Returns: vector

Method.png distanceToLine(Vector1,Vector2)

Description: the distance between the vector and a line through Vector1 in direction Vector2.

Returns: float

Method.png distanceToLineSegment(Vector1,Vector2)

Description: a vector to the closest point on a line segment from Vector1 to Vector2.

Returns: vector

Method.png distanceToPlane(Vector1,Vector2)

Description: the distance between the vector and a plane defined by a point and a normal.

Returns: float

Method.png dot(Vector)

Description: the dot product between 2 vectors.

Returns: float

Method.png getAngle(Vector)

Description: the angle in radians between this vector and another.

Returns: float

Method.png multiply(Float)

Description: multiplies (uniform scale) a vector by the given factor.

Returns: nothing

Method.png normalize( )

Description: normalizes a vector (sets its length to 1.0).

Returns: nothing

Method.png projectToLine(Vector1,Vector2)

Description: projects the vector on a line through Vector1 in direction Vector2.

Returns: nothing

Method.png projectToPlane(Vector1,Vector2)

Description: projects the vector on a plane defined by a point (Vector1) and a normal (Vector2).

Returns: nothing

Method.png scale(Float,Float,Float)

Description: Same as multiply but lets specify different values for x, y and z directions. (non-uniform scale)

Returns: nothing

Method.png sub(Vector)

Description: subtracts another vector from this one.

Returns: vector

Property.png x

Returns: the x coordinate of a vector.

Property.png y

Returns: the y coordinate of a vector.

Property.png z

Returns: the z coordinate of a vector.