
TRIANGLE                                                        27-FEB-1991 08:43:08    VAX C      V3.0-031                 Page 1
V1.0                                                            13-OCT-1987 15:19:40    BANDOL$DKA300:[RIPP.LAC]TRIANGLE.C;9 (1)

                                          0000	main:
                                    07FC  0000		.entry	main,^m<r2,r3,r4,r5,r6,r7,r8,r9,r10>
                              5E 2C C2    0002		subl2	#44,sp
                       00000000* EF 16    0005		jsb	C$MAIN
                     59 00000000 EF 9E    000B		movab	$CHAR_STRING_CONSTANTS,r9
                              F4 AD DF    0012		pushal	-12(fp)
                              F8 AD DF    0015		pushal	-8(fp)
                                 69 DF    0018		pushal	(r9)
                    52 00000000* EF 9E    001A		movab	SCANF,r2
                              62 03 FB    0021		calls	#3,(r2)
                              EC AD DF    0024		pushal	-20(fp)
                              F0 AD DF    0027		pushal	-16(fp)
                              05 A9 DF    002A		pushal	5(r9)
                              62 03 FB    002D		calls	#3,(r2)
                              E4 AD DF    0030		pushal	-28(fp)
                              E8 AD DF    0033		pushal	-24(fp)
                              0A A9 DF    0036		pushal	10(r9)
                              62 03 FB    0039		calls	#3,(r2)
                           54 F0 AD 56    003C		cvtfd	-16(fp),r4
                           56 EC AD 56    0040		cvtfd	-20(fp),r6
                           50 E8 AD 56    0044		cvtfd	-24(fp),r0
                           52 E4 AD 56    0048		cvtfd	-28(fp),r2
                              50 54 62    004C		subd2	r4,r0
                           54 50 50 65    004F		muld3	r0,r0,r4
                              52 56 62    0053		subd2	r6,r2
                           50 52 52 65    0056		muld3	r2,r2,r0
                           7E 54 50 61    005A		addd3	r0,r4,-(sp)
                    00000000* EF 02 FB    005E		calls	#2,SQRT
                              5A 50 76    0065		cvtdf	r0,r10
                           54 E8 AD 56    0068		cvtfd	-24(fp),r4
                           56 E4 AD 56    006C		cvtfd	-28(fp),r6
                           50 F8 AD 56    0070		cvtfd	-8(fp),r0
                           52 F4 AD 56    0074		cvtfd	-12(fp),r2
                              50 54 62    0078		subd2	r4,r0
                           54 50 50 65    007B		muld3	r0,r0,r4
                              52 56 62    007F		subd2	r6,r2
                           50 52 52 65    0082		muld3	r2,r2,r0
                           7E 54 50 61    0086		addd3	r0,r4,-(sp)
                    00000000* EF 02 FB    008A		calls	#2,SQRT
                              58 50 76    0091		cvtdf	r0,r8
                           54 F8 AD 56    0094		cvtfd	-8(fp),r4
                           56 F4 AD 56    0098		cvtfd	-12(fp),r6
                           50 F0 AD 56    009C		cvtfd	-16(fp),r0
                           52 EC AD 56    00A0		cvtfd	-20(fp),r2
                              50 54 62    00A4		subd2	r4,r0
                           54 50 50 65    00A7		muld3	r0,r0,r4
                              52 56 62    00AB		subd2	r6,r2
                           50 52 52 65    00AE		muld3	r2,r2,r0
                           7E 54 50 61    00B2		addd3	r0,r4,-(sp)
                    00000000* EF 02 FB    00B6		calls	#2,SQRT
                              5C 50 76    00BD		cvtdf	r0,ap
                              52 5A 56    00C0		cvtfd	r10,r2
                              50 58 56    00C3		cvtfd	r8,r0
                              52 50 60    00C6		addd2	r0,r2
                              50 5C 56    00C9		cvtfd	ap,r0
                              52 50 60    00CC		addd2	r0,r2
                              55 52 76    00CF		cvtdf	r2,r5

TRIANGLE                                                        27-FEB-1991 08:43:08    VAX C      V3.0-031                 Page 2
V1.0                                                            13-OCT-1987 15:19:40    BANDOL$DKA300:[RIPP.LAC]TRIANGLE.C;9 (1)

                           52 F8 AD 56    00D2		cvtfd	-8(fp),r2
                           50 F0 AD 56    00D6		cvtfd	-16(fp),r0
                              52 50 60    00DA		addd2	r0,r2
                           50 E8 AD 56    00DD		cvtfd	-24(fp),r0
                              52 50 60    00E1		addd2	r0,r2
                              52 14 66    00E4		divd2	#20,r2
                              54 52 76    00E7		cvtdf	r2,r4
                           52 F4 AD 56    00EA		cvtfd	-12(fp),r2
                           50 EC AD 56    00EE		cvtfd	-20(fp),r0
                              52 50 60    00F2		addd2	r0,r2
                           50 E4 AD 56    00F5		cvtfd	-28(fp),r0
                              52 50 60    00F9		addd2	r0,r2
                              52 14 66    00FC		divd2	#20,r2
                              5C 52 76    00FF		cvtdf	r2,ap
                              7E 5C 56    0102		cvtfd	ap,-(sp)
                              7E 54 56    0105		cvtfd	r4,-(sp)
                              7E 55 56    0108		cvtfd	r5,-(sp)
                            000F C9 DF    010B		pushal	15(r9)
                    00000000* EF 07 FB    010F		calls	#7,PRINTF
                         50 0001 8F 32    0116		cvtwl	#1,r0
                                    04    011B		ret	
                                          011C	distance:
                                    000C  011C		.entry	distance,^m<r2,r3>
                              5E 04 C2    011E		subl2	#4,sp
                     50 14 AC 04 AC 63    0121		subd3	4(ap),20(ap),r0
                           52 50 50 65    0127		muld3	r0,r0,r2
                     50 1C AC 0C AC 63    012B		subd3	12(ap),28(ap),r0
                              50 50 64    0131		muld2	r0,r0
                           7E 52 50 61    0134		addd3	r0,r2,-(sp)
                    00000000* EF 02 FB    0138		calls	#2,SQRT
                              50 50 76    013F		cvtdf	r0,r0
                                    04    0142		ret	

TRIANGLE                                                        27-FEB-1991 08:43:08    VAX C      V3.0-031                 Page 3
V1.0                                                            13-OCT-1987 15:19:40    BANDOL$DKA300:[RIPP.LAC]TRIANGLE.C;9 (1)



    1        	#include math
  231        	#include stdio
  473        	float distance();
  474        	main()
  475        	{
  476    1   	float ax,ay,bx,by,cx,cy; /* cooordonnees des trois sommets du triangle */
  477    1   	float la,lb,lc;          /* longueur des cotes */
  478    1   	float perimetre,baryx,baryy ;
  479    1   	
  480    1   		scanf("%f%f",&ax,&ay);
  481    1   		scanf("%f%f",&bx,&by);
  482    1   		scanf("%f%f",&cx,&cy);
  483    1   	
  484    1   		la=distance(bx,by,cx,cy);
  485    1   		lb=distance(cx,cy,ax,ay);
  486    1   		lc=distance(ax,ay,bx,by);
  487    1   	
  488    1   		perimetre=la+lb+lc;
  489    1   	
  490    1   		baryx=(ax+bx+cx)/3.;
  491    1   		baryy=(ay+by+cy)/3.;
  492    1   	
  493    1   		printf(" perimetre :%f    barycentre :%f,%f  ",perimetre,baryx,baryy);
  494    1   	}
  495        	float distance(ux,uy,vx,vy)
  496        	float ux,uy,vx,vy;
  497        	{
  498    1   	float d;
  499    1   		d=sqrt((vx-ux)*(vx-ux)+(vy-uy)*(vy-uy));
  500    1   		return(d);
  501    1   	}

 
 
Command Line
------------
 
CC/MACH=BEF/LIS TRIANGLE

