Add eulerline property to Triangle #9405

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
5 participants
@jagannath93

No description provided.

sympy/geometry/polygon.py
+
+ eulerline : Line if triangle is isoceles or right angled
+
+ common center: Point if the triangle is equilateral in which case all the all

This comment has been minimized.

@smichr

smichr May 16, 2015

Member

all the

@smichr

smichr May 16, 2015

Member

all the

This comment has been minimized.

@smichr

smichr May 16, 2015

Member

at the same place

@smichr

smichr May 16, 2015

Member

at the same place

sympy/geometry/polygon.py
@@ -2215,6 +2215,37 @@ def medial(self):
s = self.sides
return Triangle(s[0].midpoint, s[1].midpoint, s[2].midpoint)
+ @property
+ def eulerline(self):
+ """The euler line of the triangle.

This comment has been minimized.

@smichr

smichr May 16, 2015

Member

euler -> Euler

@smichr

smichr May 16, 2015

Member

euler -> Euler

sympy/geometry/polygon.py
+ Returns
+ =======
+
+ eulerline : Line if triangle is isoceles or right angled

This comment has been minimized.

@smichr

smichr May 16, 2015

Member

isoceles -> isosceles

@smichr

smichr May 16, 2015

Member

isoceles -> isosceles

@jagannath93

This comment has been minimized.

Show comment
Hide comment
@jagannath93

jagannath93 May 18, 2015

Hi @smichr , I've done all the corrections that you had mentioned.

Hi @smichr , I've done all the corrections that you had mentioned.

@@ -1436,6 +1436,12 @@ def test_polygon():
'''20151573611150265741278060334545897615974257/16073686192120448448157'''
'''8148466200000000000)''')
+ # Eulerline
+ print(t1.eulerline)

This comment has been minimized.

@debugger22

debugger22 May 18, 2015

Member

I think this print is not required.

@debugger22

debugger22 May 18, 2015

Member

I think this print is not required.

+ assert t1.eulerline in (Line(Point(5/3, 5/3), Point(5/2, 5/2)),
+ Line(Point(0, 0), Point(5/3, 5/3)),
+ Line(Point(0, 0), Point(5/2, 5/2)))
+

This comment has been minimized.

@debugger22

debugger22 May 18, 2015

Member

You should also add tests when it returns a Point.

@debugger22

debugger22 May 18, 2015

Member

You should also add tests when it returns a Point.

@gxyd

This comment has been minimized.

Show comment
Hide comment
@gxyd

gxyd Jan 10, 2018

Member

I think we can close this. eulerline method was implemented in PR #10615 . Closing this.

Member

gxyd commented Jan 10, 2018

I think we can close this. eulerline method was implemented in PR #10615 . Closing this.

@gxyd gxyd closed this Jan 10, 2018

@gxyd gxyd removed the PR: author's turn label Jan 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment