You are on page 1of 5

vertical curve

;;;;;;;;;;;;;;;;;;;;;;;;;;;;; . 2886 0096341437033


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;motee@albawaba.com
;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; load application tools
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; startup suite
;;;; verti

;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun topodwg (/)
(setvar "angdir"1)
(setvar "angbase"(/ pi 2))
(setvar "aunits"2)
(setvar "dimaunit"2)
(setvar"dimadec"4)
(setvar "dimdec"2)
(setvar "auprec"6)
(setvar "cmdecho"0)
(setvar "dimzin"0)
)
(command(topodwg))
(defun c:verti ()
(setq p0 (getpoint "\n enter start point=")
p1 (getpoint "\n click on entersection of tow line")
p2 (getpoint "\n enter any point of second line")
ang1 (angle p0 p1)
ang2 (angle p2 p1)
G (* 100 (/(sin ang1)(cos ang1)))
I (* 100 (/(sin ang2)(cos ang2)))
dx (getreal "\n enter step between points of curv=")
ang (angle p0 p1)
Page 1

vertical curve
m (*(distance p0 p1)(cos ang))
l1 (abs(* 2 m))
S (fix(/ L1 dx))
n1
ln (* n dx)
)
(setvar "osmode"0)
(initget "Right Left")
(setq x (getkword "\n direction of curve from start point<Right or Left>"))
(if (= x "Right")
(progn
(setq t1 (+(cadr p0)(*(* 0.01 G) ln)))
(setq t2 (/(*(* 0.005 (- G I))(expt ln 2)) l1))
(setq yx (- t1 t2))
(command "color"1)
(command "point" (list (+(car p0) ln) yx))
(command "color"3)
(command "point" (list (car p0)(cadr p0)))
(setq te (+(cadr p0)(*(* 0.01 G) l1)))
(setq tb (/(*(* 0.005 (- G I))(expt l1 2)) l1))
(setq ye (- te tb))
(command "point" (list (+(car p0) l1) ye))
(command "color" 1)
(command "text" p1 "1" 100 "l=")
(setq ib (polar p1 0 3))
(command "text" ib "1" 100 (rtos m 2 3))
(setq p01 (polar p0 pi 4))
(command "text" p01 "1" (- 100(/(* ang1 200)pi))(rtos (/ G 10) 2 5))
(setq p00x (polar p01(+ ang1 pi) 1.5))
(command "text" p00x "1"(- 100(/(* ang1 200)pi))(chr 37))
(setq p02 (polar p2 0 4))
(command "text" p02 "1"(- 300(/(* ang2 200)pi))(rtos (/ i 10) 2 5))
(setq p00x1(polar p02 ang2 1.5))
(command "text" p00x1 "1"(- 300(/(* ang2 200)pi))(chr 37))
(setq xi (list(car p0)(+(car p0)ln)))
(setq yi (list(cadr p0)yx))
(repeat (- s 1)
(progn
(setq n (+ 1 n))
(setq ln (* n dx))
Page 2

vertical curve
(setq t1 (+(cadr p0)(*(* 0.01 G) ln)))
(setq t2 (/(*(* 0.005 (- G I))(expt ln 2)) l1))
(setq yx (- t1 t2))
(command "point" (list (+ (car p0) ln) yx))
(setq xi (append xi (list(+(car p0)ln))))
(setq yi (append yi (list yx)))
)
)
(setq xi (append xi (list(+(car p0) l1))))
(setq yi (append yi(list ye)))
(setq lxi (length xi))
(command "color"5)
(command"spline"(list(nth 0 xi)(nth 0 yi))
(list(nth(fix(* 0.05 lxi))xi)(nth(fix(* 0.05 lxi))yi))
(list(nth(fix(* 0.1 lxi))xi)(nth(fix(* 0.1 lxi))yi))
(list(nth(fix(* 0.15 lxi))xi)(nth(fix(* 0.15 lxi))yi))
(list(nth(fix(* 0.2 lxi))xi)(nth(fix(* 0.2 lxi))yi))
(list(nth(fix(* 0.25 lxi))xi)(nth(fix(* 0.25 lxi))yi))
(list(nth(fix(* 0.3 lxi))xi)(nth(fix(* 0.3 lxi))yi))
(list(nth(fix(* 0.35 lxi))xi)(nth(fix(* 0.35 lxi))yi))
(list(nth(fix(* 0.4 lxi))xi)(nth(fix(* 0.4 lxi))yi))
(list(nth(fix(* 0.45 lxi))xi)(nth(fix(* 0.45 lxi))yi))
(list(nth(fix(* 0.5 lxi))xi)(nth(fix(* 0.5 lxi))yi))
(list(nth(fix(* 0.55 lxi))xi)(nth(fix(* 0.55 lxi))yi))
(list(nth(fix(* 0.6 lxi))xi)(nth(fix(* 0.6 lxi))yi))
(list(nth(fix(* 0.65 lxi))xi)(nth(fix(* 0.65 lxi))yi))
(list(nth(fix(* 0.7 lxi))xi)(nth(fix(* 0.7 lxi))yi))
(list(nth(fix(* 0.75 lxi))xi)(nth(fix(* 0.75 lxi))yi))
(list(nth(fix(* 0.8 lxi))xi)(nth(fix(* 0.8 lxi))yi))
(list(nth(fix(* 0.85 lxi))xi)(nth(fix(* 0.85 lxi))yi))
(list(nth(fix(* 0.9 lxi))xi)(nth(fix(* 0.9 lxi))yi))
(list(nth(fix(* 0.95 lxi))xi)(nth(fix(* 0.95 lxi))yi))
(list(last xi)(last yi)) "" "" "" )
)
)
(if (= x "Left")
(progn
(setq G (- G))
(setq I (- I))
(setq t1 (+(cadr p0)(*(* 0.01 G) ln)))
(setq t2 (/(*(* 0.005 (- G I))(expt ln 2)) l1))
Page 3

vertical curve
(setq yx (- t1 t2))
(command "color"1)
(command "point" (list (-(car p0) ln) yx))
(command "color"3)
(command "point" (list (car p0)(cadr p0)))
(setq te (+(cadr p0)(*(* 0.01 G) l1)))
(setq tb (/(*(* 0.005 (- G I))(expt l1 2)) l1))
(setq ye (- te tb))
(command "point" (list (-(car p0) l1) ye))
(command "color" 1)
(command "text" p1 "1" 100 "l=")
(setq ib (polar p1 0 3))
(command "text" ib "1"100(rtos (- m) 2 3))
(setq p01 (polar p0 0 4))
(command "text" p01 "1"(- 300(/(* ang1 200)pi))(rtos (/(- G) 10) 2 5))
(setq p00x (polar p01 ang1 1.5))
(command "text" p00x "1"(- 300(/(* ang1 200)pi))(chr 37))
(setq p02 (polar p2 pi 4))
(command "text" p02 "1"(- 100(/(* ang2 200)pi))(rtos (/ (- i) 10) 2 5))
(setq p00x1(polar p02 (+ pi ang2) 1.5))
(command "text" p00x1 "1"(- 100(/(* ang2 200)pi))(chr 37))
(setq xi (list(car p0)(-(car p0)ln)))
(setq yi (list(cadr p0)yx))
(repeat (- s 1)
(setq p01 (polar p0 0 4))
(progn
(setq n (+ 1 n))
(setq ln (* n dx))
(setq t1 (+(cadr p0)(*(* 0.01 G) ln)))
(setq t2 (/(*(* 0.005 (- G I))(expt ln 2)) l1))
(setq yx (- t1 t2))
(command "point" (list (- (car p0) ln) yx))
(setq xi (append xi (list(-(car p0)ln))))
(setq yi (append yi (list yx)))
)
)
(setq xi (append xi (list(-(car p0) l1))))
(setq yi (append yi(list ye)))
(setq lxi (length xi))
(command "color"5)
Page 4

vertical curve
(command"spline"(list(nth 0 xi)(nth 0 yi))
(list(nth(fix(* 0.05 lxi))xi)(nth(fix(* 0.05 lxi))yi))
(list(nth(fix(* 0.1 lxi))xi)(nth(fix(* 0.1 lxi))yi))
(list(nth(fix(* 0.15 lxi))xi)(nth(fix(* 0.15 lxi))yi))
(list(nth(fix(* 0.2 lxi))xi)(nth(fix(* 0.2 lxi))yi))
(list(nth(fix(* 0.25 lxi))xi)(nth(fix(* 0.25 lxi))yi))
(list(nth(fix(* 0.3 lxi))xi)(nth(fix(* 0.3 lxi))yi))
(list(nth(fix(* 0.35 lxi))xi)(nth(fix(* 0.35 lxi))yi))
(list(nth(fix(* 0.4 lxi))xi)(nth(fix(* 0.4 lxi))yi))
(list(nth(fix(* 0.45 lxi))xi)(nth(fix(* 0.45 lxi))yi))
(list(nth(fix(* 0.5 lxi))xi)(nth(fix(* 0.5 lxi))yi))
(list(nth(fix(* 0.55 lxi))xi)(nth(fix(* 0.55 lxi))yi))
(list(nth(fix(* 0.6 lxi))xi)(nth(fix(* 0.6 lxi))yi))
(list(nth(fix(* 0.65 lxi))xi)(nth(fix(* 0.65 lxi))yi))
(list(nth(fix(* 0.7 lxi))xi)(nth(fix(* 0.7 lxi))yi))
(list(nth(fix(* 0.75 lxi))xi)(nth(fix(* 0.75 lxi))yi))
(list(nth(fix(* 0.8 lxi))xi)(nth(fix(* 0.8 lxi))yi))
(list(nth(fix(* 0.85 lxi))xi)(nth(fix(* 0.85 lxi))yi))
(list(nth(fix(* 0.9 lxi))xi)(nth(fix(* 0.9 lxi))yi))
(list(nth(fix(* 0.95 lxi))xi)(nth(fix(* 0.95 lxi))yi))
(list(last xi)(last yi)) "" "" "" )
)
)
(setvar "osmode" 553)
)

Page 5

You might also like