0 Members and 1 Guest are viewing this topic.
(defun asin (xxxx) (atan (/ xxxx (sqrt (- 1.0 (expt xxxx 2))))))(defun c:pt3 (/ xpt2 ypt2 be a b sinal ug y x xpt3 ypt3) (setq xpt2 0 ypt2 0 be (/ (* 95 pi) 180) a 0.2 b 10.0 sinal (/ (* a (sin be)) b) ug (- pi be (asin sinal)) y (* b (cos ug)) x (* b (sin ug)) xpt3 (+ xpt2 x) ypt3 (- ypt2 y) ) (alert (strcat "x = " (rtos xpt3 2 4) "\ny = " (rtos ypt3 2 4))) (princ))
(defun asin (xxxx) (atan (/ xxxx (sqrt (- 1.0 (expt xxxx 2))))))(defun c:pt3 (/ xpt2 ypt2 be a b sinal y x xpt3 ypt3) (setq xpt2 0 ypt2 0 be (/ (* 80.2583 pi) 180) a 0.5 b 20.0)(cond ((> pi be (* pi 0.5)) (setq sinal (/ (* a (sin be)) b) ug (- pi be (asin sinal)) y (* b (cos ug)) x (* b (sin ug)) xpt3 (+ xpt2 x) ypt3 (- ypt2 y) ) (alert (strcat "x = " (rtos xpt3 2 4) "\ny = " (rtos ypt3 2 4)))) ((< 0 be (* pi 0.5)) (setq sinal (/ (* a (sin be)) b) ug (- pi (- pi be (asin sinal))) y (* b (cos ug)) x (* b (sin ug)) xpt3 (+ xpt2 x) ypt3 (+ ypt2 y) ) (alert (strcat "x = " (rtos xpt3 2 4) "\ny = " (rtos ypt3 2 4)))) (t nil)) (princ))
(defun ptx (d u h e / x) (list (* (sin (setq u (/ (* pi u) 180.))) (setq x (+ (* e (cos u)) (sqrt (- (expt d 2.0) (expt (* e (sin u)) 2.0) ) ) ) ) ) (+ h (* x (cos u))) ))
(defun c:slopepoint ( / A ANG ANGR D EDM P PP PT PTT TG X X1 X2 Y) (setq pt (getpoint "\nPick point from witch to calculate coordinates of new point - point on top of theodolite : ")) (setvar 'orthomode 1) (setq EDM (getdist pt "\nPick height of EDM [make sure you typed correct SI unit - m, cm, mm,...] : ")) (setvar 'orthomode 0) (setq ptt (polar pt (/ pi 2.0) EDM)) (setq D (getdist ptt "\nPick slope distance [make sure you typed correct SI unit - m, cm, mm,...] : ")) (while (not (>= 180.0 (setq A (getreal "\nInput angle of zenith in decimal degrees [180 >= A >= 90] : ")) 90.0))) (setq ang (- A 90.0)) (setq angr (cvunit ang "degrees" "radians")) (setq tg (/ (sin angr) (cos angr)));; (x*tg+EDM)^2+x^2=D^2;; x^2*tg^2+2*x*tg*EDM+EDM^2+x^2-D^2=0;; x^2*(tg^2+1)+x*2*tg*EDM+EDM^2-D^2=0;; x=(-tg*EDM +- (sqrt (tg^2*EDM^2 - (tg^2+1)*(EDM^2-D^2)))) / (tg^2+1) (setq x1 (/ (+ (* (- 1) tg EDM) (sqrt (- (* (expt tg 2) (expt EDM 2)) (* (+ (expt tg 2) 1.0) (- (expt EDM 2) (expt D 2)))))) (+ (expt tg 2) 1.0))) (setq x2 (/ (- (* (- 1) tg EDM) (sqrt (- (* (expt tg 2) (expt EDM 2)) (* (+ (expt tg 2) 1.0) (- (expt EDM 2) (expt D 2)))))) (+ (expt tg 2) 1.0))) (if (minusp x2) (setq x x1) (setq x x2)) (setq y (* x tg)) (setq pp (list x (- y) 0.0)) (setq p (mapcar '+ pt pp)) (prompt "\nDestination point has these coordinates : ")(print p) (textpage) (princ))
(defun ptx ( d u h e / a b ) (setq a (/ (* e (sin (setq u (* pi (/ u 180.0))))) d) b (- pi u (atan a (sqrt (- 1.0 (* a a))))) ) (list (* d (sin b)) (- (+ e h) (* d (cos b)))))
I guess you have to convert degrees to radians, but how?
(defun dmsr (deg mi sec); degrees, minutes, seconds (/ (* pi (+ deg (/ mi 60.0)(/ sec 3600.0))) 180.0))
angtof
(defun ptx (p1 p2 a r) (polar (setq P1 (inters P1 (polar P1 a 10.0) P2 (polar P2 (+ A (/ pi 2.)) 10.0) nil)) A (sqrt (- (expt R 2) (expt (distance P2 P1) 2))) ))
(setq p1 (getpoint "\n P1") a (getorient p1 "\n angle") p2 (getpoint "\n P2") r 10.)(ptx p1 p2 a r)