# nodesnim/core/circle2

Dark Mode

Search:
Group by:

Provides Circle2 type.

# Imports

vector2

# Types

    Circle2Obj = object
      x*, y*, r*: float

    Circle2Ref = ref Circle2Obj

# Procs

    proc Circle2(x, y, r: float): Circle2Ref {...}{.raises: [], tags: [].}

  Creates a new Circle2 object.

  Arguments:

  - `x` is a center circle point at X axis.
  - `y` is a center circle point at Y axis.
  - `r` is a circle radius.

  Examples:

      var circle = Circle2(10, 10, 5)

    proc Circle2(vec: Vector2Ref; r: float): Circle2Ref {...}{.raises: [], tags: [].}

  Creates a new Circle2 object.

  Arguments:

  - `vec` is a circle center position.
  - `r` is a circle radius.

    proc contains(self: Circle2Ref; x, y: float): bool {...}{.raises: [], tags: [].}

  Returns true, if `x`,`y` in the circle.

    proc contains(self: Circle2Ref; vec2: Vector2Ref): bool {...}{.inline, raises: [], tags: [].}

  Returns true, if `vec2` in the circle.

    proc contains(self, other: Circle2Ref): bool {...}{.raises: [], tags: [].}

  Returns true, if `self` intersects with `other` circle.

    proc contains(self: Circle2Ref; a, b: Vector2Ref): bool {...}{.raises: [], tags: [].}

    proc `$`(self: Circle2Ref): string {...}{.raises: [], tags: [].}