Matrix

This class represents the concept Matrix.

Class

class Mathematics
class Matrix
   property coordinates
      range double (64 bit), cardinality [0, 12]
   property _11
      range double (64 bit), cardinality [0, 1]
   property _12
      range double (64 bit), cardinality [0, 1]
   property _13
      range double (64 bit), cardinality [0, 1]
   property _21
      range double (64 bit), cardinality [0, 1]
   property _22
      range double (64 bit), cardinality [0, 1]
   property _23
      range double (64 bit), cardinality [0, 1]
   property _31
      range double (64 bit), cardinality [0, 1]
   property _32
      range double (64 bit), cardinality [0, 1]
   property _33
      range double (64 bit), cardinality [0, 1]
   property _41
      range double (64 bit), cardinality [0, 1]
   property _42
      range double (64 bit), cardinality [0, 1]
   property _43
      range double (64 bit), cardinality [0, 1]

subClasses 
      class InverseMatrix
      class MatrixMultiplication    

Example

Here you can find code snippits that show how the API call Matrix can be used.

using Engine;

public void CreateMatrix()
{
    Int64 model = Engine.x86_64.CreateModel();

    if (model != 0)
    {
        //
        //  Classes
        //
        Int64   classCylinder = Engine.x86_64.GetClassByName(model, "Cylinder"),
                classMatrix = Engine.x86_64.GetClassByName(model, "Matrix"),
                classTransformation = Engine.x86_64.GetClassByName(model, "Transformation");

        //
        //  Object Properties (relations)
        //
        Int64   propertyMatrix = Engine.x86_64.GetPropertyByName(model, "matrix"),
                propertyObject = Engine.x86_64.GetPropertyByName(model, "object");

        //
        //  Datatype Properties (attributes)
        //
        Int64   property_41 = Engine.x86_64.GetPropertyByName(model, "_41"),
                property_42 = Engine.x86_64.GetPropertyByName(model, "_42"),
                property_43 = Engine.x86_64.GetPropertyByName(model, "_43"),
                propertyLength = Engine.x86_64.GetPropertyByName(model, "length"),
                propertyRadius = Engine.x86_64.GetPropertyByName(model, "radius"),
                propertySegmentationParts = Engine.x86_64.GetPropertyByName(model, "segmentationParts");

        //
        //  Instances (creating)
        //
        Int64   myInstanceCylinder = Engine.x86_64.CreateInstance(classCylinder, (string) null),
                myInstanceMatrix = Engine.x86_64.CreateInstance(classMatrix, (string) null),
                myInstanceTransformation = Engine.x86_64.CreateInstance(classTransformation, (string) null);

        Engine.x86_64.SetObjectProperty(myInstanceTransformation, propertyObject, ref myInstanceCylinder, 1);
        Engine.x86_64.SetObjectProperty(myInstanceTransformation, propertyMatrix, ref myInstanceMatrix, 1);

        double  length = 2.8,
                radius = 1.3;
        Int64   segmentationParts = 36;

        Engine.x86_64.SetDatatypeProperty(myInstanceCylinder, propertyLength, ref length, 1);
        Engine.x86_64.SetDatatypeProperty(myInstanceCylinder, propertyRadius, ref radius, 1);
        Engine.x86_64.SetDatatypeProperty(myInstanceCylinder, propertySegmentationParts, ref segmentationParts, 1);

        double  offsetX = 3.3,
                offsetY = -1.2,
                offsetZ = 0.5;
        Engine.x86_64.SetDatatypeProperty(myInstanceMatrix, property_41, ref offsetX, 1);
        Engine.x86_64.SetDatatypeProperty(myInstanceMatrix, property_42, ref offsetY, 1);
        Engine.x86_64.SetDatatypeProperty(myInstanceMatrix, property_43, ref offsetZ, 1);

        //
        //  The resulting model can be viewed in 3D-Editor.exe
        //
        Engine.x86_64.SaveModel(model, "c:\\created\\myMatrix.bin");
        Engine.x86_64.CloseModel(model);
    }
}