Author Topic: verifying angles in a point list  (Read 2943 times)

0 Members and 1 Guest are viewing this topic.

ItsNerfOrNothing

  • Guest
verifying angles in a point list
« on: August 21, 2018, 09:35:05 AM »
I have a list of points from a poly line that runs in the 0.0 direction & the Y value may or may not change.
When verifying the angle from said point to the next point I run into where the angle is equal to [ 360.0 or (*2.0 pi) ] instead of an angle of 0.0.
Is this a quirk ? or do I just need to make a check and convert the results to 0.0 ?
It only happens when the direction is 0.0

Thanks in advance for any suggestsions or ideas.

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: verifying angles in a point list
« Reply #1 on: August 21, 2018, 09:54:03 AM »
It's not a quirk, you should check and convert angle to 0.0...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ItsNerfOrNothing

  • Guest
Re: verifying angles in a point list
« Reply #2 on: August 21, 2018, 10:01:31 AM »
Thanks ribarm

ronjonp

  • Needs a day job
  • Posts: 7526
Re: verifying angles in a point list
« Reply #3 on: August 21, 2018, 10:14:20 AM »
What does this return on your angle in question? (rem (getangle) pi)


Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ItsNerfOrNothing

  • Guest
Re: verifying angles in a point list
« Reply #4 on: August 21, 2018, 03:05:02 PM »
I get "3.14159" = pi

ronjonp

  • Needs a day job
  • Posts: 7526
Re: verifying angles in a point list
« Reply #5 on: August 21, 2018, 03:38:43 PM »
I get "3.14159" = pi
Hmmm .. so your angle is not really 0.
Code: [Select]
(rem (* (+ pi pi) 0.999999999999) pi)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ItsNerfOrNothing

  • Guest
Re: verifying angles in a point list
« Reply #6 on: August 21, 2018, 03:52:16 PM »
ronjonp, I see what your saying. thanks.
Just going to need to make a check with a fuzz of 1/4 of a deg.

these points are generated from a user selecting points on a drawing so I guess some inacuracies should be expected.

(if (equal (result angle) (* pi 2.0) 0.00436332)
 0.0
 (result angle)
)

Thanks again for the input, nice to see a different angle on something.

ronjonp

  • Needs a day job
  • Posts: 7526
Re: verifying angles in a point list
« Reply #7 on: August 21, 2018, 04:24:45 PM »
ronjonp, I see what your saying. thanks.
...
Thanks again for the input, nice to see a different angle on something.
I see what you did there ... punny :)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC