Author Topic: Calculating a point defining a line  (Read 5152 times)

0 Members and 1 Guest are viewing this topic.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Calculating a point defining a line
« Reply #15 on: March 13, 2007, 02:03:07 PM »
Great solutions .. I was able to utilize both of the solutions from CAB and Evgeniy and I now have a working solution.

Thanks for the help guys ... I really appreciate it.

Code: [Select]
(defun getPx (pt1 pt2 thick / ang)
  (defun asin (z /)
    (atan z (sqrt (- 1.0 (* z z))))
  )
  (defun absdis (p1 p2)
    (abs (- p1 p2))
  )
  (setq ang (- (/ pi 2.0) (asin (/ thick (distance pt1 pt2)))))
  (polar pt1 (+ ang (atan (/ (absdis (cadr pt1) (cadr pt2)) (absdis (car pt1) (car pt2))))) thick)
)
« Last Edit: March 13, 2007, 03:03:30 PM by Keith™ »
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie