Vous êtes sur la page 1sur 43

NAME ROLL NO PROGRAM 1 ( defun c:PROG1() (setq s1 (getreal "Enter length of 1st side: ")) (setq s2 (getreal "Enter

length of 2nd side: ")) (setq s3 (getreal "Enter length of 3rd side: ")) (cond ;For sorting given sides in ascending order ( (> s1 s2) (setq temp1 s2) (setq s2 s1) (setq s1 temp1) ) ( (> s2 s3) (setq temp2 s3) (setq s3 s2) (setq s2 temp2) ) ( (> s1 s2) (setq temp3 s2) (setq s2 s1) (setq s1 temp3) ) ) (cond ( (> (+ s1 s2) s3) ;For checking condition for triangle (setq pt1 (getpoint "Enter insertion point of triangle: ")) (setq pt2 (list (+ (car pt1) s1) (cadr pt1))) (setq x (/ (+ (* s1 s1) (- (* s2 s2) (* s3 s3))) (* 2 s1))) ;x=(a^2 + b^2 - c^2)/(2a) (setq z (- (* s2 s2) (* x x))) ;y=sqrt(b^2 - x^2) (setq y (sqrt z)) (setq pt3 (list (+ (car pt1) x) (+ (cadr pt1) y))) (command "line" pt1 pt2 pt3 pt1 "") ) ( (<= (+ s1 s2) s3) (princ "These sides do not form a triangle") ) ) )

****************OUTPUT****************** Command: PROG1 Enter length of 1st side: 5 Enter length of 2nd side: 3 Enter length of 3rd side: 7 Enter insertion point of triangle:

NAME ROLL NO PROGRAM 2 ( defun c:PROG2() (setq c1 (getpoint "Select center of flange: ")) (setq dia (getreal "Enter diameter of flange: ")) (setq pcd (getreal "Enter p.c.d: ")) (setq c2 (list (car c1) (+ (cadr c1) (/ pcd 2)))) (setq rhole (getreal "Enter hole radius :")) (setq n (getint "Enter no.of holes :")) (command "circle" c1 (/ dia 2)) (command "circle" c2 rhole) (command "array" "l" "" "p" c1 n "360" "n") (setq pt1 (list (- (car c1) (* dia 0.8)) (cadr c1))) (setq pt2 (list (+ (car c1) (* dia 0.8)) (cadr c1))) (command "line" pt1 pt2 "" ) (setq pt3 (list (car c1) (- (cadr c1) (* dia 0.8)))) (setq pt4 (list (car c1) (+ (cadr c1) (* dia 0.8)))) (command "line" pt3 pt4 "" ) ) ******************OUTPUT****************** Command: PROG2 Select center of flange: Enter diameter of flange: 20 Enter p.c.d: 12 Enter hole radius :0.5 Enter no.of holes :8

NAME ROLL NO PROGRAM 3 ( defun c:PROG3() (setq pt1 (getpoint "Enter one endpoint of diagonal of quadrilateral: ")) (setq pt3 (getpoint "Enter other endpoint of diagonal of quadrilateral: ")) (setq pt2 (list (car pt3) (cadr pt1))) (setq pt4 (list (car pt1) (cadr pt3))) (setq x1 (- (car pt3) (car pt1))) (setq x (abs x1)) (setq y1 (- (cadr pt3) (cadr pt1))) (setq y (abs y1)) (command "line" pt1 pt2 pt3 pt4 pt1 "") (cond ( (= x y) (princ "Quadrilateral is square") ) ( (/= x y) (princ "Quadrilateral is rectangle") ) ) (princ) ) ***************OUTPUT***************** Command: PROG3 Enter one endpoint of diagonal of quadrilateral: Enter other endpoint of diagonal of quadrilateral: Quadrilateral is rectangle

NAME ROLL NO PROGRAM 4 ( defun c:PROG4() (setq s1 (getreal "Enter length of 1st side: ")) (setq s2 (getreal "Enter length of 2nd side: ")) (setq s3 (getreal "Enter length of 3rd side: ")) (if (> s1 s2) ;For sorting given sides in ascending order (progn (setq temp1 s2) (setq s2 s1) (setq s1 temp1) ) () ) (if (> s2 s3) (progn (setq temp2 s3) (setq s3 s2) (setq s2 temp2) ) () ) (if (> s1 s2) (progn (setq temp3 s2) (setq s2 s1) (setq s1 temp3) ) () ) (cond ( (> (+ s1 s2) s3) (setq pt1 (getpoint "Enter insertion point of triangle: ")) (setq pt2 (list (+ (car pt1) s1) (cadr pt1))) (setq x (/ (+ (* s1 s1) (- (* s2 s2) (* s3 s3))) (* 2 s1))) (setq z (- (* s2 s2) (* x x))) (setq y (sqrt z)) (setq pt3 (list (+ (car pt1) x) (+ (cadr pt1) y))) (command "line" pt1 pt2 pt3 pt1 "") (cond

( (and (= s1 s2) (= s2 s3)) (princ "Triangle is equilateral") ) ( (or (= s1 s2) (= s2 s3) (= s1 s3)) (princ "Triangle is isosceles") ) (princ "Triangle is scalene") ) ) ( (<= (+ s1 s2) s3) (princ "These sides do not form a triangle") )

;Condition for equilateral

;Condition for isosceles

) ) *******************OUTPUT******************* C:PROG4 Command: PROG4 Enter length of 1st side: 5 Enter length of 2nd side: 3 Enter length of 3rd side: 7 Enter insertion point of triangle: Triangle is scalene

NAME ROLL NO PROGRAM 5 ( defun c:PROG5() (setq c (getpoint "Select center of circle: ")) (setq r (getreal "Enter radius of circle: ")) (command "circle" c r) (setq pt1 (getpoint "Select any point on the screen: ")) (setq x (- (car pt1) (car c))) (setq y (- (cadr pt1) (cadr c))) (setq z (+ (* x x) (* y y))) (setq dis (sqrt z)) (cond ( (> dis r) (princ "Point selected lies outside circle") ) ( (< dis r) (princ "Point selected lies inside circle") ) ( (= dis r) (princ "Point lies on circle") ) ) ) ******************OUTPUT******************** C:PROG5 Command: PROG5 Select center of circle: Enter radius of circle: 5 Select any point on the screen: Point selected lies outside circle

NAME ROLL NO PROGRAM 6 ( defun c:PROG6() (setq a (entget (car (entsel "Select object: ")))) (cond ( (= (cdr (assoc 0 a)) "LINE") (setq pt1 (cdr (assoc 10 a))) (setq pt2 (cdr (assoc 11 a))) (princ "End coordinates are ") (princ pt1) (princ pt2) (setq len (distance pt1 pt2)) (princ "Length of line is ") (princ len) ) ( (= (cdr (assoc 0 a)) "CIRCLE") (setq c (cdr (assoc 10 a))) (princ "Center of circle is ") (princ c) (setq r (cdr (assoc 40 a))) (princ "Radius of circle is ") (princ r) ) ) (princ) ) *************OUTPUT*************************** C:PROG6 Command: PROG6 Select object: Center of circle is (25.3331 13.5295 0.0) Radius of circle is 6.15538

NAME ROLL NO PROGRAM 7 ( defun c:PROG7() (setq c (getpoint "Select center of circle: ")) (setq r (getreal "Enter radius of circle: ")) (command "circle" c r) (setq opt (getint "Select option for hatching 1 or 2 : ")) (if (= opt 1) (progn (command "bhatch" "select") (setq a (entsel "Select object to hatch: ")) (command a "" "") ) (progn (command "bhatch" "internal" "") (setq b (getpoint "Select internal point for hatching: ")) (command b "") ) ) ) ************OUTPUT******************** Command: PROG7 Select center of circle: Enter radius of circle: 5 Select option for hatching 1 or 2 : 1

NAME ROLL NO PROGRAM 8 ( defun c:PROG8() (setq c1 (getpoint "Select center of arc: ")) (setq pt1 (getpoint "Select start point of arc: ")) (setq pt2 (getpoint "Select end point of arc: ")) (command "arc" "c" c1 pt1 pt2) (setq ang (angle c1 pt1)) (princ "Included angle is ") (princ ang) (princ) (setq r (distance c1 pt1)) (setq angd (/ ang 5)) (setq i 1) (setq ang1 angd) (command "line" c1 pt1 "") ( while (<= i 6) (setq pt1 (polar c1 ang1 r)) (command "line" c1 pt1 "") (setq ang1 (+ ang1 angd)) (setq i (+ i 1)) ) (command "line" c1 pt2 "") ) *******************OUTPUT***************************

NAME ROLL NO PROGRAM 9 ( defun c:PROG9() (setq a (entget (car (entsel "Select circle: ")))) (setq c (cdr (assoc 10 a))) (setq r (cdr (assoc 40 a))) (setq a (entget (car (entsel "Select square: ")))) (setq pt1 (cdr (assoc 10 a))) (setq dis (distance pt1 c)) (if (= dis r) (princ "Circle is circumscribing square ") (princ "Circle is inscribed in square ") ) (princ) ) ******************OUTPUT********************* Command: PROG9 Select circle: Select square: Circle is circumscribing square Command: PROG9 Select circle: Select square: Circle is inscribed in square

NAME ROLL NO PROGRAM 10 ( defun c:PROG10() (setq pt1 (getpoint "Select starting point of line: ")) (setq pt2 (getpoint "Select endpoint of line: ")) (command "line" pt1 pt2 "") (setq pt3 (getpoint "Select a point on the line: ")) (setq x (- (car pt2) (car pt1))) (setq y (- (cadr pt2) (cadr pt1))) (setq mid (list (+ (car pt1) (/ x 2)) (+ (cadr pt1) (/ y 2)))) (setq a (- (car mid) (car pt1))) (setq b (- (cadr mid) (cadr pt1))) (setq dismid (sqrt (+ (* a a) (* b b)))) ;Distance of midpt w.r.t 1st point (setq c (- (car pt3) (car pt1))) (setq d (- (cadr pt3) (cadr pt1))) (setq dispt3 (sqrt (+ (* c c) (* d d)))) ;Distance of selected pt w.r.t 1st point (cond ( (> dismid dispt3) (princ "Selected point is to the left of midpoint of line") ) ( (< dismid dispt3) (princ "Selected point is to the right of midpoint of line") ) ( (= dismid dispt3) (princ "You have selected the midpoint") ) ) ) *****************OUTPUT************************ Command: PROG10 Select starting point of line: Select endpoint of line: Select a point on the line: Selected point is to the right of midpoint of line

NAME ROLL NO. PROGRAM 11 ( defun c:PROG11_2() (setq x (getint "Enter series variable: ")) (setq n (getint "Enter length of series: ")) (setq i 1) (setq sum 0) ( while (<= i n) (setq sum1 (* (expt (- 0 1) (+ i 1)) (expt x i))) (setq sum (+ sum sum1)) (setq i (+ i 1)) ) (princ "Sum is ") (princ sum) (princ) ) *************OUTPUT************************* C:PROG11_2 Command: PROG11_2 Enter series variable: 2 Enter length of series: 4 Sum is -10

NAME ROLL NO PROGRAM 12 ( defun c:PROG12() (setq pt1 (getpoint "Enter start point: ")) (setq n (getreal "Enter no. of forces: ")) (setq a pt1) (setq i 1) (command "pline" pt1) ( while (<= i n) (setq mag (getreal "Enter magnitude of force: ")) (setq ang (getreal "Enter angle of force: ")) (setq pt2 (polar pt1 (* (/ pi 180) ang) mag)) (command pt2) (setq pt1 pt2) (setq i (+ i 1)) ) (command a "") (setq mag1 (distance a pt2)) (setq ang1 (angle a pt2)) (prompt "Magnitude = ") (princ mag1) (prompt "Angle = ") (princ ang1) (princ) ) *****************OUTPUT****************** Command: PROG12 Enter start point: Enter no. of forces: 2 Enter magnitude of force: 30 Enter angle of force: 45 Enter magnitude of force: 30 Enter angle of force: 120 Magnitude = 47.6012 Angle = 1.4399

NAME ROLL NO PROGRAM 13 ( defun c:PROG13() (setq pt1 (getpoint "Enter start point: ")) (setq n (getint "Enter no. of sides: ")) (setq l (getreal "Enter length of sides: ")) (setq angv (/ 360 n)) (setq ang 0) (setq i 1) (setq a pt1) (command "pline" pt1 ) ( while (<= i n) (setq pt2 (polar pt1 (* ang (/ pi 180)) l)) (command pt2) (setq ang (+ ang angv)) (setq pt1 pt2) (setq i (+ i 1)) ) (command a "") ) *********************OUTPUT*********************** C:PROG13 Command: PROG13 Enter start point: Enter no. of sides: 5 Enter length of sides: 10

NAME ROLL NO PROGRAM 14 ( defun c:PROG14_2() (setq c1 (getpoint "Select center of circle: ")) (setq r (getreal "Enter radius of circle: ")) (setq pt1 (polar c1 (/ (* pi 3) 2) r)) (command "point" pt1) (command "array" "l" "" "p" c1 "720" "" "n") ) ******************OUTPUT****************** Command: PROG14_2 Select center of circle: Enter radius of circle: 5

NAME ROLL NO PROGRAM 16 ( defun c:PROG16() (setq a (entget (car (entsel "Select circle: ")))) (setq c (cdr (assoc 10 a))) (setq r (cdr (assoc 40 a))) (setq ans y) ( while (/= ans "n") (setq c2 (getpoint "\nSelect center for circle to move: ")) (command "circle" c2 r) (setq ans (getstring "Do you want to continue: y / n : ")) ) (princ) ) *************************OUTPUT********************** Command: PROG16 Select circle: Select center for circle to move: Do you want to continue: y / n : y Select center for circle to move Do you want to continue: y / n : n

NAME ROLL NO PROGRAM 17 ( defun c:PROG17() (setq x (getreal "Enter a number: ")) (setq a (list x (* 4 x))) (command "pline" a) ( while (>= x 0.1) (setq a (list x (* 4 x))) (command a) (setq x (- x 0.1)) ) (command "") ) *********************OUTPUT******************** C:PROG17 Command: PROG17 Enter a number: 6

NAME ROLL NO PROGRAM 18 ( defun c:PROG18() (setq pt1 (getpoint "Select insertion point: ")) ;1st heading (setq pt2 (polar pt1 0 30)) ;2nd heading (setq pt3 (polar pt1 0 60)) ;3rd heading (setq pt4 (polar pt1 0 90)) ;4th heading (setq pt5 (polar pt1 0 120)) ;5th heading (setq pt6 (polar pt5 0 30)) ;Line end for row of box (setq pt7 (polar pt1 (/ pi 2) 100)) ;Line start for column of box (command "text" (polar pt1 (/ pi 4) 8) 2.5 0 "Part No." "" "") ;Polar command for spacing from border of box (command "text" (polar pt2 (/ pi 4) 8) 2.5 0 "Description." "" "") (command "text" (polar pt3 (/ pi 4) 8) 2.5 0 "Material." "" "") (command "text" (polar pt4 (/ pi 4) 8) 2.5 0 "Qty." "" "") (command "text" (polar pt5 (/ pi 4) 8) 2.5 0 "Remarks." "" "") (command "line" pt1 pt6 "") (command "array" "l" "" "r" 9 1 12.5) (command "line" pt1 pt7 "") (command "array" "l" "" "r" 1 6 30) ) *******************OUTPUT************************ C:PROG18 Command: PROG18 Select insertion point:

NAME ROLL NO PROGRAM 19 ( defun c:PROG19() (setq a (entget (car (entsel "Select circle: ")))) (setq c (cdr (assoc 10 a))) (setq r (cdr (assoc 40 a))) (setq c2 (getpoint "\nSelect center for circle to move: ")) (command "circle" c2 r) ) ****************OUTPUT********************** C:PROG19 Command: PROG19 Select circle: Select center for circle to move:

NAME ROLL NO PROGRAM 20 ( defun c:PROG20() (setq pt1(list 2 5)) (setq pt2(list 3 6)) (setq pt3(list 8 7)) (setq pt4(list 5 8)) (command "pline"pt1 pt2 pt3 pt4 "") (command "spline"pt1 pt2 pt3 pt4"" "" "" ) ) ***************OUTPUT*********************

NAME ROLL NO PROGRAM 21 ( defun c:PROG21() (setq a (entget (car (entsel "Select line: ")))) (setq pt1 (cdr (assoc 10 a))) (setq pt2 (cdr (assoc 11 a))) (princ "End coordinates are ") (princ pt1) (princ pt2) (setq len (distance pt1 pt2)) (princ "Length of line is ") (princ len) (princ) ) ******************OUTPUT********************* C:PROG21 Command: PROG21 Select line: End coordinates are (-19.0157 20.4025 0.0)(-14.477 29.4409 0.0)Length of line is 10.1139

NAME ROLL NO PROGRAM 22 ( defun c:PROG22() (setq a (entget (car (entsel "Select circle: ")))) (setq c (cdr (assoc 10 a))) (setq r (cdr (assoc 40 a))) (princ "Center of circle is ") (princ c) (princ "Radius of circle is ") (princ r) (setq a (* pi r r)) (princ "Area of circle is ") (princ a) (princ) ) *****************OUTPUT********************* Command: PROG22 Select circle: Center of circle is (-64.8579 67.7705 0.0) Radius of circle is 15.2586 Area of circle is 731.437

NAME ROLL NO PROGRAM 23 ( defun c:PROG23() (setq a (entget (car (entsel "Select object: ")))) (setq type (cdr (assoc 0 a))) (princ "Entity type is ") (princ type) (princ) ) **********************OUTPUT******************* C:PROG23 Command: PROG23 Select object: Entity type is CIRCLE

PROG.NO:24 NAME: ROLL NO: (defun C:RECT() (setq p1(getpoint "\nEnter the first corner : ") p2(getpoint "\nEnter the second corner : ") p3(list (car p2) (cadr p1)) p4(list (car p1) (cadr p2)) ) (command"LINE" p1 p3 p2 p4 p1 "") (princ len ) ) ***********************************OUTPUT***************************** Command: RECT Enter the first corner : 9,9 Enter the second corner : 20,20

PROG.NO:25 NAME: ROLL NO:

(defun c:triangle() (setq p1 (getpoint "\n Enter the first point of the triangle: ")) (setq p2 (getpoint "\n Enter the second point of the triangle: ")) (setq p3 (getpoint "\n Enter the third point of the triangle: ")) (command "line" p1 p2 p3 "c") )

****************************OUTPUT******************************* Command: TRIANGLE Enter the first point of the triangle: 10,20 Enter the second point of the triangle:30,60 Enter the third point of the triangle: 20,80

PROG.NO:26 NAME: ROLL NO:

(defun c:hexa() (setq p1(getpoint "enter start point")) (setq l(getreal "enter length of sides")) (setq a p1) (setq i 1) (setq angv(/ 360 6)) (setq ang 0) (command "pline" p1) (while (<= i 6) (setq p2(polar p1(* (/ pi 180) ang)1)) (command p2) (setq ang(+ ang angv)) (setq p1 p2) (setq i(+ i 1)) ) (command a "") (princ) )

****************************OUTPUT******************************** Command: HEXA enter start point10,10 enter length of sides35

PROG.NO:27 NAME: ROLL NO:

(defun C:string() (setq str1 "college") (setq str2 "P") (setq str4 (substr str1 1 4)) (princ str4) (setq int1 (strlen str4)) (princ int1) (setq str5 (strcat str4 "" str2)) (princ str5) (princ) ) ******************************OUTPUT********************************** Command: STRING coll4collP

PROG.NO:28 NAME: ROLL NO:

(defun c:rect() (setq a(getpoint "\n Enter Insertion Point: ") l(getreal "\n Enter Length of rectangle: ") br(getreal "\n Enter Breadth of rectangle: ") ) (setq b(list (+ (car a) br) (cadr a)) c(list (+ (car a) br) (+ (cadr a) l)) d(list (car a) (+ (cadr a) l)) ) (setq p(list (+ (car a) (/ br 2.0)) (cadr a)) q(list (+ (car a) br) (+ (cadr a) (/ l 2.0))) r(list (+ (car a) (/ br 2.0)) (+ (cadr a) l)) s(list (car a) (+ (cadr a) (/ l 2.0))) ) (command "pline" a b c d a "" "pline" p q r s p "" ) (setq ent(ssget "x")) (command "hatch" "" "2" "" ent "") ) *******************************OUTPUT****************************** Command: RECT Enter Insertion Point: 10,30 Enter Length of rectangle: 40 Enter Breadth of rectangle: 60

PROG.NO:29 NAME: ROLL NO:

(defun c:maths() (setq x (getreal "\n Enter value of x: ")) (setq y (- (expt x 8) (/ 4 (expt x 9)) (/ 3 x) 4)) (princ "The answer is: ") (princ y) )

**************************OUTPUT*****************************

Command: MATHS Enter value of x: 10 The answer is: 1.0e+0081.0e+008

PROG.NO:30 NAME: ROLL NO: (defun c:pr30() (setq pt1(getpoint "\n Enter first point: ") H(getreal "Enter height of equilateral triangle: ") L(/ H (sin (/ pi 3))) A(* 0.5 H L ) P(* 3 L) pt2(polar pt1 0 L) pt3(polar pt1 (/ pi 3) L) ) (command "pline" pt1 pt2 pt3 "C") (print L) (print A) (print P) )

**************************OUTPUT***************************** Enter first point: 9,9 Enter height of equilateral triangle: 7 8.0829 28.2902 24.2487 24.2487

NAME ROLL NO PROGRAM 31 ( defun c:PROG31() (setq pt1 (getpoint "\n enter 1st point")) (setq H (getreal "\n enter height of triangle")) (setq B (getreal "\n enter base of triangle")) (setq L (sqrt (+ (expt H 2) (expt (/ B 2 ) 2)))) (princ "Length is ") (princ L) (setq A (* 0.5 B H)) (princ "Area is ") (princ A) (setq P (+ (* L 2) B)) (princ "Perimeter is ") (princ P) (setq pt2(polar pt1 0 B)) (setq pt3(list(+ (nth 0 pt1) (/ B 2)) (+ (nth 1 pt1) H))) (command "pline" pt1 pt2 pt3 pt1 "") (princ) ) ***************OUTPUT********************* C:PROG31 Command: PROG31 Enter 1st point Enter height of triangle25 Enter base of triangle10 Length is 25.4951 Area is 125.0 Perimeter is 60.9902

NAME ROLL NO PROGRAM 32 ( defun c:PROG32() (setq pt1 (getpoint"enter 1st point")) (setq D (getreal"enter diagonal length")) (setq l (/ D (sqrt 2))) (princ "Length of side ") (princ l) (setq A (expt l 2)) (princ "Area is ") (princ A) (setq p (* 4 l)) (princ "Perimeter is ") (princ p) (setq pt2 (polar pt1 0 l)) (setq pt3 (polar pt2 (/ pi 2) l)) (setq pt4 (polar pt3 pi l)) (command "pline" pt1 pt2 pt3 pt4 pt1 "") (princ) ) *************OUTPUT********************** C:PROG32 Command: PROG32 Enter 1st point Enter diagonal length20 Length of side 14.1421 Area is 200.0 Perimeter is 56.5685

NAME ROLL NO PROGRAM 33 ( defun c:PROG33() (setq a (getreal "enter area")) (setq pt1(getpoint"enter start point")) (setq l(sqrt(/ (* 2 a) (sin (/ pi 3))))) (princ "Length is ") (princ l) (setq p(* 3 l)) (princ "Perimeter is ") (princ p) (setq pt2(polar pt1 0 l)) (setq pt3(polar pt1 (/ pi 3) l)) (command "pline" pt1 pt2 pt3 pt1 "") ) **************OUTPUT********************* C:PROG33 Command: PROG33 Enter area : 45

PROG.NO:34 NAME: ROLL NO:

(defun c:PR34() (setq O(getpoint "\n enter centre") A(getreal "\n enter area of circle") R(sqrt (/ A pi)) P(* 2 pi R) ) (command "circle" O R "") (print P) (print R) ) **************************OUTPUT***************************** enter centre10,10 enter area of circle40 22.42 3.56825 3.56825

NAME ROLL NO PROGRAM 35 ( defun c:PROG35() (setq c (getpoint "Select center of nut: ")) (setq r (getreal "Enter radius of nut: ")) (command "polygon" "6" c "i" r) (command "circle" c r) ) ****************OUTPUT******************* Command: PROG35 Select center of nut: Enter radius of nut: 5

PROG.NO:36 NAME: ROLL NO:

(defun C:dist() (setq A(getpoint "\n enter first point:") B(getpoint "\n enter second point:") L(distance A B) ) (print L) ) (defun C:ang() (setq A(getpoint "\n enter first point:") B(getpoint "\n enter second point:") L(angle A B) ) (print L) ) **********************************OUTPUT**************************************** Command: dist Specify first point: 10,20 Specify second point: 20,30 Distance = 14.1421, Angle in XY Plane = 45, Angle from XY Plane = 0 Delta X = 10.0000, Delta Y = 10.0000, Delta Z = 0.0000 Command: ang enter first point:10,20 enter second point:20,30 0.785398 0.785398

PROG.NO:37 NAME: ROLL NO:

(defun C:prg37() (setq A(GETSTRING "\n Enter X cordinate: ") B(GETSTRING "\n ENTER Y cordinate: ") C(atof A) D(atof B) P(list C D) Q(GETSTRING "\n Enter X cordinate: ") R(GETSTRING "\n ENTER Y cordinate: ") T(atof Q) U(atof R) J(list T U) H(list T D) G(list C U) ) (command "pline" P H J G P "") ) ********************************OUTPUT******************************* Command: prg37 Enter X cordinate: 30 ENTER Y cordinate: 50 Enter X cordinate: 20 ENTER Y cordinate: 45

PROG.NO:38 NAME: ROLL NO:

(defun C:prg38() (setq A(GETSTRING "\N Enter X cordinate: ") B(GETSTRING "\N ENTER Y cordinate: ") C(atof A) D(atof B) P(list C D) L(getreal "\n Enter length: ") Q(polar P 0.0 L) R(polar Q (/ pi 3.0) L) S(polar R (* 2 (/ pi 3.0)) L) T(polar S pi L) W(polar T (* 4 (/ pi 3.0)) L) ) (command "line" P Q R S T W P "") )

**************************OUTPUT**************************** Command: PRG38 Enter X cordinate: 10 ENTER Y cordinate: 20 Enter length: 30

PROG.NO:39 NAME: ROLL NO:

(defun C:prg39() (setq A(GETSTRING "\N Enter X cordinate: ") B(GETSTRING "\N ENTER Y cordinate: ") C(atof A) D(atof B) P(list C D) L(getreal "\n Enter length: ") Q(polar P 0.0 L) R(polar Q (* 2 (/ pi 5.0)) L) S(polar R (* 4 (/ pi 5.0)) L) T(polar S (* 6 (/ pi 5.0)) L) ) (command "line" P Q R S T P "") )

**********************************OUTPUT******************************

Command: PRG39 N Enter X cordinate: 10 N ENTER Y cordinate: 30 Enter length: 60

PROG.NO:40 NAME: ROLL NO: (defun c:PR40() (textscr) (setq r (getreal "\n Enter a real value: ")) (setq j (getstring "\n Enter your first name: ")) (setq rcon (rtos r)) (setq jlen (strlen j)) (setq jstr (itoa jlen)) (setq a "2") (setq b "3") (setq i1 (atoi a)) (setq r1 (atof b)) (setq res (* i1 r1)) (print (strcat "The value of real number you entered is " rcon)) (print (strcat "Your name contains " (strcat jstr " letters"))) (print (strcat (strcat "The multiplication of " a) (strcat " and " b))) (print res) ) **********************************OUTPUT****************************** Enter a real value: 50 Enter your first name: AMEYA "The value of real number you entered is 4'-2.0000\"" "Your name contains 5 letters" "The multiplication of 2 and 3" 6.0 6.0