invert

fun Circle.invert(point: Vector2): Vector2(source)

Performs circle inversion of a point.

Circle inversion is a geometric transformation where a point is mapped to another point along the same ray from the center, but at a distance that is inversely proportional to the original distance.

The formula used is: P' = C + r²/|P-C|² * (P-C) Where:

  • P is the point to invert

  • C is the center of the circle

  • r is the radius of the circle

  • P' is the inverted point

Return

The inverted point

Parameters

point

The point to invert


fun Circle.invert(circle: Circle): GeometricPrimitive2D(source)

Performs circle inversion of another circle.

Circle inversion maps a circle to another circle (or a line, which can be considered a circle with infinite radius).

There are several cases:

  1. If the circle to be inverted passes through the center of the inverting circle, the result is a line

  2. If the circle to be inverted doesn't contain the center of the inverting circle, the result is another circle

  3. If the circle to be inverted contains the center of the inverting circle, the result is also a circle

Return

The inverted circle

Parameters

circle

The circle to invert

Throws

if the circle to be inverted is centered at the center of the inverting circle


fun Circle.invert(segment: LineSegment): GeometricPrimitive2D(source)