Below I attached the existing code that you will be editing.
In all of the cases below, the arguments are all points.
Add the following:
0) A new method: distPoint. It takes two arguments, self and other. It returns the distance between the points.
If you're unsure of the formula for distance between two points,
see [login to view URL]
Remember that you are using points in three dimensions. The formula given is for two dimensions.
1) A new method: trianglePerimeter. It takes three arguments; self, p2 and p3. It returns the perimeter of the area defined by self -> p2 -> p3. It must calculate the distance from self to p2, p2 to p3, and p3 back to self, and return the sum of them.
2) A new method: triangleArea. It also takes three arguments; self, p2, and p3. It returns the area of the triangle defined by self, p2, and p3.
For the area, we do the following calculations:
Start with the length of each side (copy the code from trianglePerimeter). Calculate the half perimeter p. Then the area is (p * (p - len1) * (p - len2) * (p - len3))**2
3) Demonstrate that your code works. Use:
p1 at 0, 0, 0
p2 at 2, 0, 0
p3 at 0, 3, 0
Print the points and the Perimeter and Area - verify that the answers for this are correct (it's a right triangle in two dimensions)
p1 at 1, 2, 3
p2 at 1, 8, 6
p3 at 4, 4, 3
Print the points and the Perimeter and Area
Turn in the following:
- One file named [login to view URL] with your new methods
- One file named [login to view URL] with the Idle output (you can save from File->Save in Idle, like I did in the lectures)
8 freelancers are bidding on average $23 for this job
Hey, I have more than 5 years of experience in python. You can check my profile that I almost have done every project in python. I hope you will be happy from the service.
Hi there, I do Python programming. I went through your requirements and I would like to do this project if given the opportunity. Let me know if you are interested.
Hello Sir, You will get a proven working project and will add a writing guide explaining everything starting from algorithm to how to run the progra, ready to work on it ASAP Looking to hearing from you best regards
Hello, I can write the python script you need in a short time with all the requirements. I will start working immediatly if you accept my offer. We can iterate on the delivered project if you need something else.
sure delivery within a day with proper comments and documentation, 2 years experience with python programming and app development. Will be pleased if considered.