Matrix API/en: Difference between revisions
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
⚫ | |||
{{VeryImportantMessage|(October 2019) Do not edit this page. The information is incomplete and outdated. For the latest API, see the [https://www.freecadweb.org/api autogenerated API documentation], or generate the documentation yourself, see [[Source documentation|Source documentation]].}} |
|||
4x4 Matrixes are used everywhere throughout FreeCAD and can be created by one of the following manners: |
4x4 Matrixes are used everywhere throughout FreeCAD and can be created by one of the following manners: |
||
{{Code|code= |
|||
<pre> |
|||
m=FreeCAD.Matrix() # m = the [http://en.wikipedia.org/wiki/Identity_matrix identity matrix] |
m = FreeCAD.Matrix() # m = the [http://en.wikipedia.org/wiki/Identity_matrix identity matrix] |
||
m=FreeCAD.Base.Matrix() |
m = FreeCAD.Base.Matrix() |
||
print m.A21() # print m[1][0] |
print m.A21() # print m[1][0] |
||
}} |
|||
</pre> |
|||
{{APIFunction|A| | |all the matrix elements.}} |
{{APIFunction|A| | |all the matrix elements.}} |
||
{{APIFunction|A11| | |a matrix element.}} |
|||
{{APIFunction|A12| | |a matrix element.}} |
|||
{{APIFunction|A13| | |a matrix element.}} |
|||
{{APIFunction|A14| | |a matrix element.}} |
|||
{{APIFunction|A21| | |a matrix element.}} |
|||
{{APIFunction|A22| | |a matrix element.}} |
|||
{{APIFunction|A23| | |a matrix element.}} |
|||
{{APIFunction|A24| | |a matrix element.}} |
|||
{{APIFunction|A31| | |a matrix element.}} |
|||
{{APIFunction|A32| | |a matrix element.}} |
|||
{{APIFunction|A33| | |a matrix element.}} |
|||
{{APIFunction|A34| | |a matrix element.}} |
|||
{{APIFunction|A41| | |a matrix element.}} |
|||
{{APIFunction|A42| | |a matrix element.}} |
|||
{{APIFunction|A43| | |a matrix element.}} |
|||
{{APIFunction|A44| | |a matrix element.}} |
|||
{{APIFunction|determinant| |Computes the [http://en.wikipedia.org/wiki/Determinant determinant] of the matrix|a number.}} |
|||
{{APIFunction|inverse| |[http://en.wikipedia.org/wiki/Inverse_matrix Inverts] this matrix, if possible|nothing.}} |
|||
{{APIFunction|invert| |Returns the [http://en.wikipedia.org/wiki/Inverse_matrix inverse] of this matrix, if possible|a Matrix}} |
|||
{{APIFunction|move|Vector|Makes this matrix a [http://en.wikipedia.org/wiki/Translation_%28geometry%29 translation] matrix|nothing.}} |
|||
{{APIFunction|multiply|Matrix or Vector|Returns the [http://en.wikipedia.org/wiki/Cross_product cross product] of a matrix or vector with this matrix|a Matrix}} |
|||
{{APIFunction|rotateX|Float(radians)|Makes this matrix a [http://en.wikipedia.org/wiki/Rotation_%28mathematics%29 rotation] about X transform|nothing.}} |
|||
{{APIFunction|rotateY|Float(radians)|Makes this matrix a [http://en.wikipedia.org/wiki/Rotation_%28mathematics%29 rotation] about Y transform|nothing.}} |
|||
{{APIFunction|rotateZ|Float(radians)|Makes this matrix a [http://en.wikipedia.org/wiki/Rotation_%28mathematics%29 rotation] about Z transform|nothing.}} |
|||
{{APIFunction|scale|Vector|Makes this matrix a [http://en.wikipedia.org/wiki/Scaling_matrix scaling transform]|nothing.}} |
|||
{{APIFunction|transform|Vector, Matrix|Makes this matrix a [http://en.wikipedia.org/wiki/Transformation_matrix transformation matrix] based on Vector and Matrix|nothing. }} |
|||
{{APIFunction|unity| |Makes this matrix the [http://en.wikipedia.org/wiki/Identity_matrix identity matrix]|nothing.}} |
|||
{{Userdocnavi{{#translation:}}}} |
|||
[[Category:API]] |
[[Category:API{{#translation:}}]] |
||
[[Category:Poweruser Documentation{{#translation:}}]] |
|||
{{clear}} |
{{clear}} |
||
⚫ |
Latest revision as of 21:01, 27 February 2020
4x4 Matrixes are used everywhere throughout FreeCAD and can be created by one of the following manners:
m = FreeCAD.Matrix() # m = the [http://en.wikipedia.org/wiki/Identity_matrix identity matrix]
m = FreeCAD.Base.Matrix()
print m.A21() # print m[1][0]
Description: Computes the determinant of the matrix
Returns: a number.
Description: Inverts this matrix, if possible
Returns: nothing.
Description: Returns the inverse of this matrix, if possible
Returns: a Matrix
Description: Makes this matrix a translation matrix
Returns: nothing.
Description: Returns the cross product of a matrix or vector with this matrix
Returns: a Matrix
Description: Makes this matrix a rotation about X transform
Returns: nothing.
Description: Makes this matrix a rotation about Y transform
Returns: nothing.
Description: Makes this matrix a rotation about Z transform
Returns: nothing.
Description: Makes this matrix a scaling transform
Returns: nothing.
Description: Makes this matrix a transformation matrix based on Vector and Matrix
Returns: nothing.
Description: Makes this matrix the identity matrix
Returns: nothing.
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Start, Surface, TechDraw, Test Framework, Web
- Hubs: User hub, Power users hub, Developer hub