# Geometry Helpers

*API Collection*

## Topics

### Rounding and Grid

- [`GSUnitVector`](/Core/GlyphsCore/GSUnitVector)
- [`GSCross`](/Core/GlyphsCore/GSCross)
- [`GSRoundHandle`](/Core/GlyphsCore/GSRoundHandle)
- [`GSRoundGrid`](/Core/GlyphsCore/GSRoundGrid)
- [`GSRoundPoint`](/Core/GlyphsCore/GSRoundPoint)
- [`GSRoundPointToDirection`](/Core/GlyphsCore/GSRoundPointToDirection)
- [`GSRoundPointToLine`](/Core/GlyphsCore/GSRoundPointToLine)
- [`GSRoundPointGrid`](/Core/GlyphsCore/GSRoundPointGrid)
- [`GSRoundPointGridSetting`](/Core/GlyphsCore/GSRoundPointGridSetting)
- [`GSRoundPointGridSettingMax`](/Core/GlyphsCore/GSRoundPointGridSettingMax)
- [`GSRoundSize`](/Core/GlyphsCore/GSRoundSize)
- [`GSRoundRectGrid`](/Core/GlyphsCore/GSRoundRectGrid)
- [`GSRoundRect`](/Core/GlyphsCore/GSRoundRect)

### Point, Size, and Rect Utilities

- [`GSMaxPoint`](/Core/GlyphsCore/GSMaxPoint)
- [`GSMinPoint`](/Core/GlyphsCore/GSMinPoint)
- [`GSScaleRect`](/Core/GlyphsCore/GSScaleRect)
- [`GSScaleRectAroundPoint`](/Core/GlyphsCore/GSScaleRectAroundPoint)
- [`GSCenteredRectInRect`](/Core/GlyphsCore/GSCenteredRectInRect)
- [`GSValidateRect`](/Core/GlyphsCore/GSValidateRect)
- [`GSValidateRange`](/Core/GlyphsCore/GSValidateRange)
- [`GSScaleSize`](/Core/GlyphsCore/GSScaleSize)
- [`GSScalePoint`](/Core/GlyphsCore/GSScalePoint)
- [`GSAddPoints`](/Core/GlyphsCore/GSAddPoints)
- [`GSSubtractPoints`](/Core/GlyphsCore/GSSubtractPoints)
- [`GSFlipUnitPoint`](/Core/GlyphsCore/GSFlipUnitPoint)
- [`GSInterpolatePoints`](/Core/GlyphsCore/GSInterpolatePoints)
- [`GSAbsolutePointInRect`](/Core/GlyphsCore/GSAbsolutePointInRect)
- [`GSRelativePointInRect`](/Core/GlyphsCore/GSRelativePointInRect)

### Vectors and Distances

- [`GSUnitVectorFromTo`](/Core/GlyphsCore/GSUnitVectorFromTo)
- [`GSUnitVectorFromAngle`](/Core/GlyphsCore/GSUnitVectorFromAngle)
- [`GSNormalVector1`](/Core/GlyphsCore/GSNormalVector1)
- [`GSNormalVector2`](/Core/GlyphsCore/GSNormalVector2)
- [`GSSkewVectorRelativeToItself`](/Core/GlyphsCore/GSSkewVectorRelativeToItself)
- [`GSSquareDistance`](/Core/GlyphsCore/GSSquareDistance)
- [`GSDistance`](/Core/GlyphsCore/GSDistance)
- [`GSLengthOfVector`](/Core/GlyphsCore/GSLengthOfVector)
- [`GSDistanceN`](/Core/GlyphsCore/GSDistanceN)

### Angles and Slopes

- [`GSNormalizeAngleRAD`](/Core/GlyphsCore/GSNormalizeAngleRAD) — Returns a value in the interval [0, 2π).
- [`GSNormalizeAngleDEG`](/Core/GlyphsCore/GSNormalizeAngleDEG) — Returns a value in the interval [0, 360).
- [`GSNormalizeAngleDirection`](/Core/GlyphsCore/GSNormalizeAngleDirection) — Returns a version of the angle that matches the given direction.
- [`GSSlope`](/Core/GlyphsCore/GSSlope)

### Rect Geometry

- [`GSRectFromTwoPoints`](/Core/GlyphsCore/GSRectFromTwoPoints)
- [`GSRectFromFourPoints`](/Core/GlyphsCore/GSRectFromFourPoints) — Returns the bounds of the given four points.
- [`GSRectInsetWithEdgeInsets`](/Core/GlyphsCore/GSRectInsetWithEdgeInsets)

### General Geometry

- [`GSAngleOfVector`](/Core/GlyphsCore/GSAngleOfVector)
- [`GSAngleBetweenVectors`](/Core/GlyphsCore/GSAngleBetweenVectors)
- [`GSSlantPointAroundY`](/Core/GlyphsCore/GSSlantPointAroundY)
- [`GSCircleSegmentFromPointsAndTangents`](/Core/GlyphsCore/GSCircleSegmentFromPointsAndTangents)
- [`GSOffsetLine`](/Core/GlyphsCore/GSOffsetLine)
- [`GSDot`](/Core/GlyphsCore/GSDot)
- [`GSClamp`](/Core/GlyphsCore/GSClamp)
- [`GSAreaOfTriangle`](/Core/GlyphsCore/GSAreaOfTriangle)
- [`GSPointIsLeftOfLine`](/Core/GlyphsCore/GSPointIsLeftOfLine)
- [`GSLeftRayHitsLine`](/Core/GlyphsCore/GSLeftRayHitsLine)
- [`GSLeftRayHitsSegment`](/Core/GlyphsCore/GSLeftRayHitsSegment)
- [`GSLeftRayHitsCubic`](/Core/GlyphsCore/GSLeftRayHitsCubic)
- [`GSLeftRayHitsQuadraticSpline`](/Core/GlyphsCore/GSLeftRayHitsQuadraticSpline)
- [`GSMiddlePointLine`](/Core/GlyphsCore/GSMiddlePointLine)
- [`GSMiddlePointCubic`](/Core/GlyphsCore/GSMiddlePointCubic)
- [`GSCheckColinearLines`](/Core/GlyphsCore/GSCheckColinearLines)

### Intersections

- [`GSIntersectCubicCubicPoints`](/Core/GlyphsCore/GSIntersectCubicCubicPoints)
- [`GSIntersectCubicCubicPointsA`](/Core/GlyphsCore/GSIntersectCubicCubicPointsA)
- [`GSIntersectCubicCubicUnlimited`](/Core/GlyphsCore/GSIntersectCubicCubicUnlimited)
- [`GSIntersectCubicCubicUnlimitedA`](/Core/GlyphsCore/GSIntersectCubicCubicUnlimitedA)
- [`GSIntersectCubicLine`](/Core/GlyphsCore/GSIntersectCubicLine) — Finds all intersections between a curve and a line.
- [`GSIntersectCubicLineA`](/Core/GlyphsCore/GSIntersectCubicLineA)
- [`GSIntersectCubicLineTimes`](/Core/GlyphsCore/GSIntersectCubicLineTimes)
- [`GSIntersectCubicLineUnlimited`](/Core/GlyphsCore/GSIntersectCubicLineUnlimited)
- [`GSIntersectCubicLineUnlimitedA`](/Core/GlyphsCore/GSIntersectCubicLineUnlimitedA)
- [`GSIntersectCubicLineUnlimitedTimes`](/Core/GlyphsCore/GSIntersectCubicLineUnlimitedTimes)
- [`GSIntersectQuadraticSplineLine`](/Core/GlyphsCore/GSIntersectQuadraticSplineLine)
- [`GSIntersectQuadraticSplineLineA`](/Core/GlyphsCore/GSIntersectQuadraticSplineLineA)
- [`GSIntersectQuadraticLineMatchEndA`](/Core/GlyphsCore/GSIntersectQuadraticLineMatchEndA)
- [`GSIntersectQuadraticLine`](/Core/GlyphsCore/GSIntersectQuadraticLine)
- [`GSIntersectQuadraticQuadraticSpline`](/Core/GlyphsCore/GSIntersectQuadraticQuadraticSpline)
- [`GSIntersectQuadraticQuadraticSplineA`](/Core/GlyphsCore/GSIntersectQuadraticQuadraticSplineA)
- [`GSIntersectCubicQuadraticSpline`](/Core/GlyphsCore/GSIntersectCubicQuadraticSpline)
- [`GSIntersectCubicQuadraticSplineA`](/Core/GlyphsCore/GSIntersectCubicQuadraticSplineA)
- [`GSPointOnQuadraticSpline`](/Core/GlyphsCore/GSPointOnQuadraticSpline)
- [`GSCollinearLines`](/Core/GlyphsCore/GSCollinearLines)
- [`GSIntersectLineLine`](/Core/GlyphsCore/GSIntersectLineLine)
- [`GSIntersectLineLineUnlimited`](/Core/GlyphsCore/GSIntersectLineLineUnlimited)
- [`GSIntersectRays`](/Core/GlyphsCore/GSIntersectRays)
- [`GSIntersectLineWithRect`](/Core/GlyphsCore/GSIntersectLineWithRect)
- [`GSClipLineWithRect`](/Core/GlyphsCore/GSClipLineWithRect)
- [`GSCircleContainsRect`](/Core/GlyphsCore/GSCircleContainsRect)
- [`GSIntersectCircles`](/Core/GlyphsCore/GSIntersectCircles)

### Nearest Points and Distances

- [`GSNearestPointOnCubicSegmentBounds`](/Core/GlyphsCore/GSNearestPointOnCubicSegmentBounds)
- [`GSNearestPointOnCubicSegment`](/Core/GlyphsCore/GSNearestPointOnCubicSegment)
- [`GSNearestPointOnQuarticSegment`](/Core/GlyphsCore/GSNearestPointOnQuarticSegment)
- [`GSNearestPointOnQuartic`](/Core/GlyphsCore/GSNearestPointOnQuartic)
- [`GSNearestPointOnQuadraticPoints`](/Core/GlyphsCore/GSNearestPointOnQuadraticPoints)
- [`GSDistanceOfPointFromCurve`](/Core/GlyphsCore/GSDistanceOfPointFromCurve)
- [`GSSquareDistanceOfPointFromCurveSegment`](/Core/GlyphsCore/GSSquareDistanceOfPointFromCurveSegment)
- [`GSDistanceOfPointFromLineSegment`](/Core/GlyphsCore/GSDistanceOfPointFromLineSegment)
- [`GSDistanceOfPointFromLine`](/Core/GlyphsCore/GSDistanceOfPointFromLine)
- [`GSNearestPointOnCubic`](/Core/GlyphsCore/GSNearestPointOnCubic)
- [`GSNearestPointOnQuadraticSpline`](/Core/GlyphsCore/GSNearestPointOnQuadraticSpline)
- [`GSNearestPointOnLinePoints`](/Core/GlyphsCore/GSNearestPointOnLinePoints)
- [`GSNearestPointOnLineUnlimited`](/Core/GlyphsCore/GSNearestPointOnLineUnlimited)
- [`GSDividCubicPointsAtDistance`](/Core/GlyphsCore/GSDividCubicPointsAtDistance)

### Curve Parameters and Solvers

- [`GSCalcCubicParameters`](/Core/GlyphsCore/GSCalcCubicParameters)
- [`GSCalcQuadraticParameters`](/Core/GlyphsCore/GSCalcQuadraticParameters)
- [`GSSolveQuadratic`](/Core/GlyphsCore/GSSolveQuadratic)
- [`GSSolveCubic`](/Core/GlyphsCore/GSSolveCubic)
- [`GSDividLineAtDistance`](/Core/GlyphsCore/GSDividLineAtDistance)
- [`GSExtendCurvePoints`](/Core/GlyphsCore/GSExtendCurvePoints)
- [`GSFitCurveToOriginPoints`](/Core/GlyphsCore/GSFitCurveToOriginPoints)
- [`GSFitCurveToOriginPointsDirection`](/Core/GlyphsCore/GSFitCurveToOriginPointsDirection)
- [`GSCurveIsFlat`](/Core/GlyphsCore/GSCurveIsFlat)
- [`GSCurveIsFlatError`](/Core/GlyphsCore/GSCurveIsFlatError)

### Curve Subdivision and Conversion

- [`GSHalveCubicPoints`](/Core/GlyphsCore/GSHalveCubicPoints)
- [`GSHalveCubicSegment`](/Core/GlyphsCore/GSHalveCubicSegment)
- [`GSHalveQuadraticPoints`](/Core/GlyphsCore/GSHalveQuadraticPoints)
- [`GSHalveQuadraticSegment`](/Core/GlyphsCore/GSHalveQuadraticSegment)
- [`GSQuadratic2Cubic`](/Core/GlyphsCore/GSQuadratic2Cubic)
- [`GSDividQuadraticPoints`](/Core/GlyphsCore/GSDividQuadraticPoints)
- [`GSDividQuadraticSpline`](/Core/GlyphsCore/GSDividQuadraticSpline)
- [`GSDividCubicPoints`](/Core/GlyphsCore/GSDividCubicPoints)
- [`GSDividCubicPointsTs`](/Core/GlyphsCore/GSDividCubicPointsTs)
- [`GSDividCubicSegment`](/Core/GlyphsCore/GSDividCubicSegment)
- [`GSDividQuarticSegment`](/Core/GlyphsCore/GSDividQuarticSegment)
- [`GSApproximateQuartic`](/Core/GlyphsCore/GSApproximateQuartic)
- [`GSQuarticToCubic`](/Core/GlyphsCore/GSQuarticToCubic) — Converts from a quartic curve segment to two cubic curve segments.
- [`GSSegmentBetweenPoints`](/Core/GlyphsCore/GSSegmentBetweenPoints)

### Curve Evaluation and Tangents

- [`GSPointOnLine`](/Core/GlyphsCore/GSPointOnLine)
- [`GSPointOffsetFromLine`](/Core/GlyphsCore/GSPointOffsetFromLine) — Like `GSPointOnLine`, but with the returned point offset by a certain amount onto a parallel line. So, more like the inverse of `GSNearestPointOnLine`.
- [`GSPointOffsetAtAngle`](/Core/GlyphsCore/GSPointOffsetAtAngle) — Returns a new point offset by the given distance in the direction of the given angle in radiants.
- [`GSPointAtTime`](/Core/GlyphsCore/GSPointAtTime)
- [`GSPointOnCubicPoints`](/Core/GlyphsCore/GSPointOnCubicPoints)
- [`GSPointOnCubicSegment`](/Core/GlyphsCore/GSPointOnCubicSegment)
- [`GSPointOnQuarticPoints`](/Core/GlyphsCore/GSPointOnQuarticPoints)
- [`GSPointOnQuarticSegment`](/Core/GlyphsCore/GSPointOnQuarticSegment)
- [`GSPointOnQuadraticPoints`](/Core/GlyphsCore/GSPointOnQuadraticPoints)
- [`GSTangentOnQuadraticPoints`](/Core/GlyphsCore/GSTangentOnQuadraticPoints)
- [`GSTangentOnQuadraticSegment`](/Core/GlyphsCore/GSTangentOnQuadraticSegment)
- [`GSTangentOnCubicSegment`](/Core/GlyphsCore/GSTangentOnCubicSegment)
- [`GSTangentOnCubicPoints`](/Core/GlyphsCore/GSTangentOnCubicPoints)
- [`GSTangentOnQuadraticThroughPoint`](/Core/GlyphsCore/GSTangentOnQuadraticThroughPoint)

### Lengths, Extrema, and Bounds

- [`GSLengthOfCubicPoints`](/Core/GlyphsCore/GSLengthOfCubicPoints)
- [`GSLengthOfQuadraticSpline`](/Core/GlyphsCore/GSLengthOfQuadraticSpline)
- [`GSTForDistanceCubic`](/Core/GlyphsCore/GSTForDistanceCubic)
- [`GSTForDistanceQuadraticSpline`](/Core/GlyphsCore/GSTForDistanceQuadraticSpline)
- [`GSExtremeTimesOfCubicUnlimited`](/Core/GlyphsCore/GSExtremeTimesOfCubicUnlimited)
- [`GSExtremeTimesOfCubic`](/Core/GlyphsCore/GSExtremeTimesOfCubic)
- [`GSExtremePointsOfCubic`](/Core/GlyphsCore/GSExtremePointsOfCubic)
- [`GSExtremesOfCubic`](/Core/GlyphsCore/GSExtremesOfCubic)
- [`GSTangentPointsAtAngel`](/Core/GlyphsCore/GSTangentPointsAtAngel)
- [`GSBoundsOfQuadratic`](/Core/GlyphsCore/GSBoundsOfQuadratic)
- [`GSBoundsOfQuadraticSpline`](/Core/GlyphsCore/GSBoundsOfQuadraticSpline)
- [`GSBoundsOfCubic`](/Core/GlyphsCore/GSBoundsOfCubic)
- [`GSBoundingRectOfCubic`](/Core/GlyphsCore/GSBoundingRectOfCubic)
- [`GSBoundsOfQuartic`](/Core/GlyphsCore/GSBoundsOfQuartic)
- [`GSBoundingRectOfQuadratic`](/Core/GlyphsCore/GSBoundingRectOfQuadratic)
- [`GSBoundsOfTransformedRect`](/Core/GlyphsCore/GSBoundsOfTransformedRect)

### Inflections, Curvature, and Normals

- [`GSCubicHasInflection`](/Core/GlyphsCore/GSCubicHasInflection)
- [`GSComputeInflection`](/Core/GlyphsCore/GSComputeInflection)
- [`GSComputeInflectionTimes`](/Core/GlyphsCore/GSComputeInflectionTimes)
- [`GSComputeInflectionTimesTolerance`](/Core/GlyphsCore/GSComputeInflectionTimesTolerance)
- [`GSTransformComponents`](/Core/GlyphsCore/GSTransformComponents)
- [`curvatureMaxima`](/Core/GlyphsCore/curvatureMaxima)
- [`GSCurvatureSquaredForT`](/Core/GlyphsCore/GSCurvatureSquaredForT)
- [`GSSignedCurvatureForT`](/Core/GlyphsCore/GSSignedCurvatureForT) — Use this function as compared to `curvatureSquaredForT` if you compute the square root of the result anyway or if you need to know the sign of the curvature.
- [`GSNormalCubicForT`](/Core/GlyphsCore/GSNormalCubicForT)
- [`GSNormalQuadraticForT`](/Core/GlyphsCore/GSNormalQuadraticForT)

### Curve Repair and Combination

- [`GSCombineSegments3`](/Core/GlyphsCore/GSCombineSegments3)
- [`GSCombineSegments3Fit`](/Core/GlyphsCore/GSCombineSegments3Fit)
- [`GSFixDeadCurve`](/Core/GlyphsCore/GSFixDeadCurve)
- [`GSNormalizeCubicHandleRatios`](/Core/GlyphsCore/GSNormalizeCubicHandleRatios)
- [`GSGetOptimalSplitParameter`](/Core/GlyphsCore/GSGetOptimalSplitParameter)
- [`GSShiftPointAlongLine`](/Core/GlyphsCore/GSShiftPointAlongLine)
- [`GSFixBounds`](/Core/GlyphsCore/GSFixBounds)

### N-Dimensional Vectors

- [`GSMakeNVector`](/Core/GlyphsCore/GSMakeNVector)
- [`GSInitNVector`](/Core/GlyphsCore/GSInitNVector)
- [`GSDistanceOfPointFromLineN`](/Core/GlyphsCore/GSDistanceOfPointFromLineN)
- [`GSMultiplyNVectors`](/Core/GlyphsCore/GSMultiplyNVectors)

### Comparison and Sorting

- [`GSSortPointValue`](/Core/GlyphsCore/GSSortPointValue)
- [`GSSortPoint`](/Core/GlyphsCore/GSSortPoint)
- [`GSSortInteger`](/Core/GlyphsCore/GSSortInteger)
- [`GSSortFloat`](/Core/GlyphsCore/GSSortFloat)
- [`GSSortFloatLenient`](/Core/GlyphsCore/GSSortFloatLenient)
- [`GSComparePoint`](/Core/GlyphsCore/GSComparePoint)
- [`GSCompareSize`](/Core/GlyphsCore/GSCompareSize)
- [`GSCompareTransformStruct`](/Core/GlyphsCore/GSCompareTransformStruct)
- [`GSAffineTransformIsIdentity`](/Core/GlyphsCore/GSAffineTransformIsIdentity)
- [`GSCompareRect`](/Core/GlyphsCore/GSCompareRect)
- [`GSCompareRange`](/Core/GlyphsCore/GSCompareRange)

### Numeric Conversion and Rotation

- [`GSFloatToFraction`](/Core/GlyphsCore/GSFloatToFraction)
- [`GSAngleToSlope`](/Core/GlyphsCore/GSAngleToSlope) — convert and angle (CCV from 12 o’clock) to run/rise as stored in the hhea table
- [`GSAngleFromString`](/Core/GlyphsCore/GSAngleFromString) — The angle of run/rise. This can be used to write the italic angle so the angle is positive CCV from 12 o’clock
- [`GSRotatePointAroundCenter`](/Core/GlyphsCore/GSRotatePointAroundCenter)
- [`GSRotatePoint`](/Core/GlyphsCore/GSRotatePoint)

### Ellipse and Rect Proximity

- [`GSNearestPointOnEllipse`](/Core/GlyphsCore/GSNearestPointOnEllipse)
- [`GSDistanceOfPointFromEllipse`](/Core/GlyphsCore/GSDistanceOfPointFromEllipse)
- [`GSNearestPointOnRect`](/Core/GlyphsCore/GSNearestPointOnRect)
- [`GSDistanceOfPointFromRect`](/Core/GlyphsCore/GSDistanceOfPointFromRect)

### Clothoids

- [`GSMakeClothoid`](/Core/GlyphsCore/GSMakeClothoid)
- [`GSMakeClothoidSymmetric`](/Core/GlyphsCore/GSMakeClothoidSymmetric)

### String Conversion

- [`GSStringFromPoint`](/Core/GlyphsCore/GSStringFromPoint)
- [`GSStringFromRect`](/Core/GlyphsCore/GSStringFromRect)
- [`GSStringFromPoint3`](/Core/GlyphsCore/GSStringFromPoint3)
- [`GSStringFromTransformStruct`](/Core/GlyphsCore/GSStringFromTransformStruct)
- [`GSAffineSolver`](/Core/GlyphsCore/GSAffineSolver)

### Rect Alignment and Handles

- [`GSRectWithCenter`](/Core/GlyphsCore/GSRectWithCenter)
- [`GSHandleRect`](/Core/GlyphsCore/GSHandleRect)
- [`GSMirrorAlignment`](/Core/GlyphsCore/GSMirrorAlignment)
- [`GSAlignedPointForBounds`](/Core/GlyphsCore/GSAlignedPointForBounds)
- [`GSHandleRectForBounds`](/Core/GlyphsCore/GSHandleRectForBounds)

### Point3

- [`GSMakePoint3`](/Core/GlyphsCore/GSMakePoint3)
- [`GSRotatePoint3`](/Core/GlyphsCore/GSRotatePoint3)
- [`GSRotatePoint3Center`](/Core/GlyphsCore/GSRotatePoint3Center)
- [`GSCalc`](/Core/GlyphsCore/GSCalc)
- [`GSPointFromArray`](/Core/GlyphsCore/GSPointFromArray)

### Miscellaneous Math and Transforms

- [`GSFindDivisorClosestTo`](/Core/GlyphsCore/GSFindDivisorClosestTo)
- [`GSAffineTransformMappingLine2Line`](/Core/GlyphsCore/GSAffineTransformMappingLine2Line)
- [`GSColinearLines`](/Core/GlyphsCore/GSColinearLines)
- [`GSColinearLinesTolerance`](/Core/GlyphsCore/GSColinearLinesTolerance)
- [`GSGreenHarmony`](/Core/GlyphsCore/GSGreenHarmony)

