Package rope.costume

Class R_Line2D

All Implemented Interfaces:
R_Constants, R_Constants_Colour

public class R_Line2D extends R_Graphic implements R_Constants
  • Constructor Details

    • R_Line2D

      public R_Line2D(processing.core.PApplet pa)
      Parameters:
      pa -
    • R_Line2D

      public R_Line2D(processing.core.PApplet pa, vec2 a, vec2 b)
      Parameters:
      pa -
      a -
      b -
    • R_Line2D

      public R_Line2D(processing.core.PApplet pa, float ax, float ay, float bx, float by)
      Parameters:
      pa -
      ax -
      ay -
      bx -
      by -
  • Method Details

    • set

      public void set(vec2 a, vec2 b)
      Parameters:
      a -
      b -
    • set

      public void set(float ax, float ay, float bx, float by)
      Parameters:
      ax -
      ay -
      bx -
      by -
    • a

      public void a(vec2 a)
      Parameters:
      a -
    • a

      public void a(float x, float y)
      Parameters:
      x -
      y -
    • b

      public void b(vec2 b)
      Parameters:
      b -
    • b

      public void b(float x, float y)
      Parameters:
      x -
      y -
    • a

      public vec2 a()
      Returns:
    • b

      public vec2 b()
      Returns:
    • offset

      public R_Line2D offset(vec2 offset)
      make a displacement of the line
      Parameters:
      offset -
      Returns:
    • show

      public void show()
    • show

      public void show(processing.core.PGraphics other)
      Parameters:
      other -
    • dist

      public float dist()
      Return the length of the line
      Returns:
    • intersection

      public vec2 intersection(R_Line2D target)
      Return the intersection point between this line and an other one.
      Parameters:
      target -
      Returns:
    • intersection

      public vec2 intersection(R_Line2D target, vec2... exception)
      Return the intersection point between this line and an other one.
      Parameters:
      target -
      exception - , list of vec2 point make an exception node, helpful when you don't want a specific node point
      Returns:
    • angle

      public float angle()
      Return the angle of the line from "a" to "b"
      Returns:
    • angle

      public R_Line2D angle(float angle)
      Change the angle from the starting point "a"
      Parameters:
      angle -
      Returns:
    • coord

      public vec2 coord(float normal_pos)
      return coordinate of the normal position on the line from the a point
      Parameters:
      normal_pos -
      Returns:
    • coord

      public vec2 coord(int rank)
      return coordinate of distance from the a point on the line
      Parameters:
      rank -
      Returns:
    • copy

      public R_Line2D copy()
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object