Verifies that a matrix is singular. Matrices that are not invertible is called singular, or degenerate, matrices. A matrix is singular if and only if its determinant is zero.
Rhino.IsXformSingular (arrXform)
arrXform |
Required. Array. A 4x4 transformation matrix. |
Boolean |
True or False indicating singular or non-singular. |
Null |
If not successful, or on error. |
Sub Main()
Dim source, target, origin, xaxis, yaxis, xform, objects, remapped
objects = Rhino.GetObjects("Select objects to remap")
If IsNull(objects) Then Exit Sub
source = Rhino.PlaneFromPoints(Array(0,160,0) , Array(0,160,1), Array(1,160,0))
If IsNull(source) Then
Rhino.Print "Source plane is invalid."
Exit Sub
End If
origin = Array(-119537.6703985986800000,182688.4167497680800000,95029.9999999806750000)
xaxis = Rhino.VectorUnitize(Array(-0.9030888831917814,0.4294536867409813,-0.0000000000116415))
yaxis = Rhino.VectorUnitize(Array(-0.4294536867409814,-0.9030888831917816,-0.0000000000000000))
target = Rhino.PlaneFromFrame(origin, xaxis, yaxis)
If IsNull(target) Then
Rhino.Print "Target plane is invalid."
Exit Sub
End If
xform = Rhino.XformRotation(source, target)
If IsNull(xform) Then
Rhino.Print "Transformation is invalid."
Exit Sub
End If
If Rhino.IsXformSingular(xform) Then
Rhino.Print "Transformation is singular."
Exit Sub
End If
remapped = Rhino.RemapObjects(objects, source, target)
If IsNull(remapped) Then Rhino.Print "Sorry, nothing remapped"
End Sub