class_docstr: Class used to plot points in Kendall shape space of 2D triangles.
  
  David G. Kendall showed that the shape space of 2D triangles is isometric
  to the 2-sphere of radius 1/2 [K1984]_. This class encodes this isometric
  representation, offering a 3D visualization of Kendall shape space of order
  (3,2), and its related objects.
  
  Attributes
  ----------
  points : list
      List of points to plot on the Kendall sphere.
  coords_type : str
      Type of the points. Can be either 'pre-shape' (for points in Kendall
      pre-shape space) or 'extrinsic' (for points given as 3x2 matrices).
      Optional, default: 'pre-shape'.
  pole : array-like, shape=[3,2]
      Equilateral triangle (north pole).
  ua : array-like, shape=[3,2]
      Tangent vector toward isosceles triangle at vertex A.
  ub : array-like, shape=[3,2]
      Tangent vector toward isosceles triangle at vertex B.
  na : array-like, shape=[3,2]
      Tangent vector such that (ua,na) is a positively oriented
      orthonormal basis of the horizontal space at north pole.
  
  References
  ----------
  .. [K1984] David G. Kendall. "Shape Manifolds, Procrustean Metrics, and
      Complex Projective Spaces." Bulletin of the London Mathematical
      Society, Volume 16, Issue 2, March 1984, Pages 81–121.
      https://doi.org/10.1112/blms/16.2.81
class_docstr_tok: ["Class","used","to","plot","points","in","Kendall","shape","space","of","2D","triangles",".","David","G.","Kendall","showed","that","the","shape","space","of","2D","triangles","is","isometric","to","the","2-sphere","of","radius","1\/2","[","K1984","]","_",".","This","class","encodes","this","isometric","representation",",","offering","a","3D","visualization","of","Kendall","shape","space","of","order","(","3,2",")",",","and","its","related","objects",".","Attributes","--","--","--","--","--","points",":","list","List","of","points","to","plot","on","the","Kendall","sphere",".","coords_type",":","str","Type","of","the","points",".","Can","be","either","'pre-shape","'","(","for","points","in","Kendall","pre-shape","space",")","or","'extrinsic","'","(","for","points","given","as","3x2","matrices",")",".","Optional",",","default",":","'pre-shape","'",".","pole",":","array-like",",","shape=","[","3,2","]","Equilateral","triangle","(","north","pole",")",".","ua",":","array-like",",","shape=","[","3,2","]","Tangent","vector","toward","isosceles","triangle","at","vertex","A.","ub",":","array-like",",","shape=","[","3,2","]","Tangent","vector","toward","isosceles","triangle","at","vertex","B.","na",":","array-like",",","shape=","[","3,2","]","Tangent","vector","such","that","(","ua",",","na",")","is","a","positively","oriented","orthonormal","basis","of","the","horizontal","space","at","north","pole",".","References","--","--","--","--","--","..","[","K1984","]","David","G.","Kendall",".","``","Shape","Manifolds",",","Procrustean","Metrics",",","and","Complex","Projective","Spaces",".","''","Bulletin","of","the","London","Mathematical","Society",",","Volume","16",",","Issue","2",",","March","1984",",","Pages","81\u2013121",".","https",":","\/\/doi.org\/10.1112\/blms\/16.2.81"]
docstr: Draw the corresponding triangle on the sphere at theta, phi.
docstr_tok: ["Draw","the","corresponding","triangle","on","the","sphere","at","theta",",","phi","."]
code: def draw_triangle(self, theta, phi, scale):
      """Draw the corresponding triangle on the sphere at theta, phi."""
      u_theta = gs.cos(theta) * self.ua + gs.sin(theta) * self.na
      triangle = (
          gs.cos(phi / 2.0) * self.pole + gs.sin(phi / 2.0) * u_theta
      )
      triangle = scale * triangle
      triangle3d = gs.transpose(
          gs.stack((triangle[:, 0], triangle[:, 1], 0.5 * gs.ones(3)))
      )
      triangle3d = self.rotation(theta, phi) @ gs.transpose(triangle3d)
  
      x = list(triangle3d[0]) + [triangle3d[0, 0]]
      y = list(triangle3d[1]) + [triangle3d[1, 0]]
      z = list(triangle3d[2]) + [triangle3d[2, 0]]
  
      self.ax.plot3D(x, y, z, "grey", zorder=1)
      c = ["red", "green", "blue"]
      for i in range(3):
          self.ax.scatter(
              x[i], y[i], z[i], color=c[i], s=10, alpha=1, zorder=1
          )
  
imports: import matplotlib.pyplot
  from mpl_toolkits.mplot3d import Axes3D
  import geomstats.backend
  from geomstats.geometry.matrices import Matrices
  from geomstats.geometry.pre_shape import PreShapeSpace
label_desc: Use image node_id 9 for calling the KendallSphere obj's underlying member method code with example usage: obj.draw_triangle(theta, phi, scale) without return types