The Angle FromXAxis Method

Use the AngleFromXAxis method to measure the angle, in radians, between an imaginary line formed by two points and the WCS X-axis. This method returns a double. It has the following syntax:

dblAngle = UtilityObject.AngleFromXAxis(StartPoint, EndPoint) Table 7-15 explains this method's parameters.

Table 7-15. The AngleFromXAxis Method's Parameters

Name

Type

Description

StartPoint

Variant

A three-element array of doubles that specifies the first point of an imaginary line in WCS

EndPoint

Variant

A three-element array of doubles that specifies the second point of an imaginary line in WCS

This example gets two points from the user and then uses the AngleFromXAxis method to calculate the angle of a line formed by those points and the WCS X-axis:

Public Sub TestAngleFromXAxis() Dim varStart As Variant Dim varEnd As Variant Dim dblAngle As Double

With ThisDrawing.Utility varStart = .GetPoint(, vbCr & "Pick the start point: ") varEnd = .GetPoint(varStart, vbCr & "Pick the end point: ") dblAngle = .AngleFromXAxis(varStart, varEnd) .Prompt vbCr & "The angle from the X-axis is " _

& .AngleToString(dblAngle, acDegrees, 2) & " degrees" End With End Sub

Was this article helpful?

0 0
100 Bowling Tips

100 Bowling Tips

Playing bowling with your friends can help you decide if it is indeed the hobby that you want to invest your time on today. Aside from that, it can help you get a better feel of the sport. More importantly, when you play with your friends, it would become a more fun activity, which you can look forward to each week.

Get My Free Ebook


Post a comment