Documentation

“Triangle Appraiser” module version 1.0

“Triangle Appraiser” module helps programmers to manipulate triangles by illustrate the mathematical values with minimum effort meanwhile enhance those values with approximations and assumptions generating using fuzzy logics.

Pre requests

This module is developed for Python 2.7

User needs to have following libraries for work with this module

Import triangle appraiser

• Save the triangle.py in to the same directory of your python 2.7 script
• For import module
• Import  triangle

Use module

This module prompts a Cartesian plane to the end user which can work interactively to take a triangle from the user.

• Prompt a Cartesian plane to get triangle from the user
1. With preview :-
• # This will prompt a preview of the triangle after get user input
• Import triangle as tr
• my_triangle = tr.Triangle(True)#create new object of Triangle

1. Without preview
• # This will avoid prompting a preview of the triangle after get user input
• Import triangle as tr
• my_triangle = tr.Triangle(False)#create new object of Triangle

After getting a triangle it can be used to calculate several mathematical features of the relevant triangle. Here following model uses to prompt all the results. To understand the results it needs to match them with that model

1. Getting given coordination to draw the triangle
1. Get only  “X” coordination list
• import triangle as tr
• my_triangle = tr.Triangle(True) #with preview
• print "X coordinates of given triangle [XA,XB,XC]= ",my_triangle.cordinate('x')

Example Output

X coordinates of given triangle [XA,XB,XC]=  [0, 40.0, 90.0]

1. Get only  “Y” coordination list
• import triangle as tr
• my_triangle = tr.Triangle(True) #with preview
• print "Y coordinates of given triangle [YA,YB,YC]= ",my_triangle.cordinate('y')

Example Output

X coordinates of given triangle [XA,XB,XC]=  [0, 40.0, 90.0]

1. Get both coordination separately in to a single  list
• import triangle as tr
• my_triangle = tr.Triangle(True) #with preview
• print "X Y coordinate list of given triangle [x,Y] = ",triangle.cordinate('')

Example Output

X Y coordinate list of given triangle [X,Y] =  ([0, 40.0, 90.0], [0, 91.0, 14.0])]

1. Getting the length of the bases
1. Get lengths separately
• import triangle as tr
• my_triangle = tr.Triangle(True) #with preview
• print "Length of base a = ", my_triangle.lengths('a')
• print "Length of base b = ", my_triangle.lengths('b')
• print "Length of base c = ", my_triangle.lengths('c')

Example Output

Length of base a =  91.8095855562

Length of base b =  91.0823802939

Length of base c =  99.4032192638

1. Get lengths as a list
• import triangle as tr
• my_triangle = tr.Triangle(True) #with preview
• print "Length of base a = ", my_triangle.lengths('')

Example Output

Length list of bases {a,b,c} =  [91.80958555619343, 91.0823802938856, 99.40321926376429]

1. Getting the size of an angle
1. Getting the size of the each angle
• import triangle as tr
• my_triangle = tr.Triangle(True) #with preview
• print "Size of angle Alpha = ", my_triangle.angles('A')
• print "Size of angle Beta = ", my_triangle.angles('B')
• print "Size of angel Gamma=", my_triangle.angles('C')

Example Output

Size of angle Alpha =  57.4297943639

Size of angle Beta =  56.7260961772

Size of angel Gamma=  65.844109459

1. Getting sizes as a list
•  import triangle as tr
• my_triangle = tr.Triangle(True) #with preview
• print "Size list of angles {alpha,beta,gamma} = ",my_triangle.angles('')

Example Output

Size list of angles {alpha,beta,gamma} =  [57.42979436385579, 56.726096177168834, 65.84410945897538]

1. Getting angles to axis (getting actual formation)
1. Angle to Y axis
• import triangle as tr
• my_triangle = tr.Triangle(True) #with preview
• print "Angle to Y axis =  ",my_triangle.angle_to_yaxis()

Example Output

Angle to Y axis =   23.728391076

1. Angle to X axis
• import triangle as tr
• my_triangle = tr.Triangle(True) #with preview
•    angle_to_xaxis = 90- (my_triangle.angle_to_yaxis()+my_triangle.angles('A'))
•    print "Angle to X axis =  ",my_triangle.angle_to_xaxis()

Example Output

Angle to X axis =   13.728391076

Output

| Page