• Create a spring between two points.

    Parameters

    • p1: Vector2

      The first point.

    • p2: Vector2

      The second point.

    • radius: number = 1

      The radius of the spring.

    • coil_number: number = 10

      The number of coils in the spring.

    • separation_coefficient: number = 0.5

      The coefficient of separation between coils. * at 0, no coils are overlapping. (there is no max value)

    • sample_number: number = 100

      The number of points to sample in the spring.

    Returns Diagram

    A diagram of the spring.