Purpose
Calculate the angle between two lines; corresponds to choosing Spatial > Edit > Calculate > Calculate Angle. This function requires the MapCAD Tool and can be executed via the Exec() command. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
Exec ("("MapCAD.mbx","CalcAngle", LineObj1, LineObj2)
Return Value
Float If the function failed the return value is 999.
Description
Use the CalcAngle function to calculate the angle between two lines in degrees. The MapCAD tool must be loaded. This function requires an active map window to determine the projection and units. To set the calculation accuracy, open the MapCAD settings dialog.
Parameters | Description |
---|---|
LineObj1 | Object value, Line |
LineObj2 | Object value, Line |
Examples
'Calculate the angle between two lines.
Dim t as float
t = Exec("MapCAD.mbx","CalcAngle",LineObj1, LineObj2)
note "Angle = " + t