// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; using System.Runtime.CompilerServices; namespace SixLabors { /// /// Utility class for common geometric functions. /// public static class GeometryUtilities { /// /// Converts a degree (360-periodic) angle to a radian (2*Pi-periodic) angle. /// /// The angle in degrees. /// /// The representing the degree as radians. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float DegreeToRadian(float degree) => degree * (MathF.PI / 180F); /// /// Converts a radian (2*Pi-periodic) angle to a degree (360-periodic) angle. /// /// The angle in radians. /// /// The representing the degree as radians. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float RadianToDegree(float radian) => radian / (MathF.PI / 180F); } }