Vector API

From FreeCAD Documentation
Revision as of 08:32, 5 February 2019 by Luc (talk | contribs) (Created page with "{{APIProperty|Length|returnează lungimea vectorului.}} {{APIFunction|add|Vector|adaugă un alt vector la acesta.|vector}} {{APIFunction|cross|Vector|produsul vectorial între...")
Other languages:

Vectorii sunt utilizați peste tot în FreeCAD.

Exempluː

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


Length

Returns: returnează lungimea vectorului.

add(Vector)

Description: adaugă un alt vector la acesta.

Returns: vector

cross(Vector)

Description: produsul vectorial între acest vector și un altul.

Returns: vector

distanceToLine(Vector1,Vector2)

Description: distanța dintre vector și o linie prin Vector1 în direcția Vector2.

Returns: float

distanceToLineSegment(Vector1,Vector2)

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

Returns: vector

distanceToPlane(Vector1,Vector2)

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

Returns: float

dot(Vector)

Description: the dot product between 2 vectors.

Returns: float

getAngle(Vector)

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

Returns: float

multiply(Float)

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

Returns: nothing

normalize( )

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

Returns: nothing

projectToLine(Vector1,Vector2)

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

Returns: nothing

projectToPlane(Vector1,Vector2)

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

Returns: nothing

scale(Float,Float,Float)

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

Returns: nothing

sub(Vector)

Description: scăderea altui vector din acesta.

Returns: vector

x

Returns: coordonata x a vectorului.

y

Returns: coordonata y a vectorului.

z

Returns: coordonata z a vectorului