Jump to content

How to determine in which quadrant pt2 is relative to pt1


gsc

Recommended Posts

Heres something to investigate:

 

_$ (setq p1 '(10. 10. 10.))
(10.0 10.0 10.0)

_$ (setq p2 '(5. 13. -4.))
(5.0 13.0 -4.0)

_$ (setq p (mapcar '- p2 p1))
(-5.0 3.0 -14.0)

_$ (setq res (mapcar 'minusp p))
(T nil T)

_$ (setq res (apply '(lambda (a b c) (list a b)) res))
(T nil)

; +X +Y = 1st
; +X -Y = second
; -X -Y = third
; -X +Y = fourth
_$ (vl-some '(lambda (x) (if (equal (cdr x) res) (car x)))
 '(
   (1st nil nil)
   (2nd nil T)
   (3rd T T)
   (4th T nil)
 )
)
4TH

 

Or just use the angle function for the p1 and p2, and determine with cond if its between 0/90/180/270.

Link to comment
Share on other sites

  • 2 months later...

Hi, the codes of both Lee and Irm return q=3 where it should be q=4 for the folowing 2 coordinats...is this correct?

 

p1 (bpt) = 494487.36,5727352.41

p2 (pnt) = 494497.36,5725787.41

 

 

Modified: Sorry miscalculation...codes are correct

Edited by gsc
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...