Returns the combination of the position and orientation of a Cartesian location_object with another Cartesian Location Object.
...location_object.Mul(location_object2)
Prerequisites
location_object and location_object2 must both be Cartesian Location Objects.
Parameters
location_object2
A required Cartesian Location Object or a method or property that returns a Cartesian Location Object value.
Remarks
This method combines the “total position” of location_object and the “total position” of location_object2. As described in the Introduction to GPL, the “total position” of a Location Object is the combination of the Location Object’sPosWrtRef with the “total position” of any reference frame(s) associated with the Location Object.
More specifically, the Mul method returns the result of evaluating the “total position” of location_object2 with respect to the PosWrtRef value of the location_object. If defined, the reference frame pointer for the location_object is copied to the returned Location and is not included in the mathematic operation. This is done to preserve the explicit reference frame relationship of the location_object.
For example, let’s consider the simple case without rotations where the location_object has an X, Y, Z value of (10,25,-40) and location_object2 has an X, Y, Z value of (0,5,0). If we now combined the values, location_object2’s incremental displacement of 5 mm along the Y-axis would be interpreted with respect to location_object’s prior translations and the combined result would be (10,30,-40). Now, we can see what happens if we change location_object so it includes a 90-degree rotation about the Z-axis (10,25,-40,0,0,90). In this case, when we combine the two values, location_object2’s Y-axis has been rotated to point along location_object’s negative X-axis. So, the resulting combination would be (5, 25,-40,0,0,90).
Assuming that location_object and location_object2 are both Cartesian Locations, the Mul method returns a Location Object with the properties in the table below.
Property | Returned Location Object value |
---|---|
Type |
Cartesian Location |
PosWrtRef |
“total position” of the location_object2 evaluated with respect to the PosWrtRef of the location_object. In terms of matrix operations, this could be written as: returned.PosWrtRef = [location_object.PosWrtRef] |
RefFrame |
Same as location_object |
All other properties |
Same as location_object |
Examples
Dim a As New Location ' Create new Location set to default values
Dim b As New Location
Dim c As Location
Dim dx, dy As Double
a.XYZ(10,25,-40,0,0,90) ' Define A
b.XYZ(0,5,0) ' Define B
c = a.Mul(b)
dx = c.X ' dx will be 5
dy = c.Y ' dy will be equal to 25
See Also
Location Class |location_object.Inverse |location_object.Pos |location_object.PosWrtRef