Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding Angle with respect to X axis in VB?

In my VB program, I used the FindStraightEdge function to get a line for a particular edge. I would like to know what is the angle with respect to X axis. In the Measurement Studio, I use the "Caliper" to find this angle; however, in VB the Caliper function doesn't seems to have an option of measuring angle. Am I missing something here???

I found the "FindAngleBetweenLines" function. Is this the only method to measure angle?

Thanks,
Simon Teng
0 Kudos
Message 1 of 2
(3,308 Views)
Simon,

Probably the easiest way to do it is to create a variable that contains a line going from 0,0 to 1,0 and use the "FindAngleBetweenLines".

Another way is to use the endpoints of the line to calculate its angle relative to horizontal. You can use atan(dy/dx).

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 2
(3,308 Views)