code: def planar_to_coordinates(p, scale):
      """
      Planar simplex (regular x,y) to maps (x,y,z) ternary coordinates. The order of the coordinates is counterclockwise
      from the origin.
  
      Parameters
      ----------
      p: 2-tuple
          The planar simplex (x, y) point to be transformed to maps (x,y,z) coordinates
  
      scale: Int
          The normalized scale of the simplex, i.e. N such that points (x,y,z)
          satisfy x + y + z == N
  
      """
      y = p[1] / SQRT3OVER2
      x = p[0] - y / 2.0
      z = scale - x - y
      return np.array([x, y, z])
  
file_path: python-ternary/ternary/helpers.py
imports: import numpy
label_desc: Use image node_id 6 for calling a global function with example usage: planar_to_coordinates(p, scale) and returns: np