Triangle with Altitudes and OrthocenterΒΆ

Plotting a triangle with its three altitudes and their intersection point, the orthocenter.

plot orthocenter


(<Figure size 640x480 with 1 Axes>, <Axes: >)

from skspatial.objects import Triangle
from skspatial.plotting import plot_2d

triangle = Triangle([0, 0], [2, 0], [1, 2])

    triangle.plotter(c='k', zorder=3),
    triangle.orthocenter().plotter(c='r', edgecolor='k', s=100, zorder=3),
    *[x.plotter(c='k', zorder=3) for x in triangle.multiple('line', 'abc')],
    *[x.plotter() for x in triangle.multiple('altitude', 'ABC')],

Total running time of the script: ( 0 minutes 0.160 seconds)

Gallery generated by Sphinx-Gallery