src/Colourful/Utils/CylindricalFormulas.cs
/// <summary>
/// Converts a vector in form of Lightness, Chroma1, Chroma2 into Lightness, Chroma, Hue.
/// </summary>
Converts a vector in form of Lightness, Chroma1, Chroma2 into Lightness, Chroma, Hue.
Converts a vector in form of Lightness Chroma1 Chroma2 into Lightness Chroma Hue .
public static double[] ConvertToLCh(in double[] sourceVector)
        {
            double chroma1 = sourceVector[1], chroma2 = sourceVector[2];
            var C = Sqrt(chroma1 * chroma1 + chroma2 * chroma2);
            var hRadians = Atan2(chroma2, chroma1);
            var hDegrees = NormalizeDegree(RadianToDegree(in hRadians));
            var targetVector = new[] { sourceVector[0], C, hDegrees };
            return targetVector;
        }
public static double [ ] ConvertToLCh ( in double [ ] sourceVector ) { double chroma1 = sourceVector [ 1 ] , chroma2 = sourceVector [ 2 ] ; var C = Sqrt ( chroma1 * chroma1 + chroma2 * chroma2 ) ; var hRadians = Atan2 ( chroma2 , chroma1 ) ; var hDegrees = NormalizeDegree ( RadianToDegree ( in hRadians ) ) ; var targetVector = new [ ] { sourceVector [ 0 ] , C , hDegrees } ; return targetVector ; }
Converts a vector in form of Lightness, Chroma1, Chroma2 into Lightness, Chroma, Hue.
Converts a vector in form of Lightness Chroma1 Chroma2 into Lightness Chroma Hue .
double[]
in