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.

int64_t model = CreateModel();

if (model) {
    //
    //  Classes
    //
    int64_t classCylinder = GetClassByName(model, "Cylinder"),
            classMatrix = GetClassByName(model, "Matrix"),
            classTransformation = GetClassByName(model, "Transformation");

    //
    //  Object Properties (relations)
    //
    int64_t propertyMatrix = GetPropertyByName(model, "matrix"),
            propertyObject = GetPropertyByName(model, "object");

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

    //
    //  Instances (creating)
    //
    int64_t myInstanceCylinder = CreateInstance(classCylinder, nullptr),
            myInstanceMatrix = CreateInstance(classMatrix, nullptr),
            myInstanceTransformation = CreateInstance(classTransformation, nullptr);

    SetObjectProperty(myInstanceTransformation, propertyObject, &myInstanceCylinder, 1);
    SetObjectProperty(myInstanceTransformation, propertyMatrix, &myInstanceMatrix, 1);

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

    SetDatatypeProperty(myInstanceCylinder, propertyLength, &length, 1);
    SetDatatypeProperty(myInstanceCylinder, propertyRadius, &radius, 1);
    SetDatatypeProperty(myInstanceCylinder, propertySegmentationParts, &segmentationParts, 1);

    double  offsetX = 3.3,
            offsetY = -1.2,
            offsetZ = 0.5;
    SetDatatypeProperty(myInstanceMatrix, property_41, &offsetX, 1);
    SetDatatypeProperty(myInstanceMatrix, property_42, &offsetY, 1);
    SetDatatypeProperty(myInstanceMatrix, property_43, &offsetZ, 1);

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