// Copyright (c) Six Labors. // Licensed under the Apache License, Version 2.0. using System.Runtime.CompilerServices; namespace SixLabors.ImageSharp { /// /// Represents a complex number, where the real and imaginary parts are stored as values. /// /// /// This is a more efficient version of the type. /// internal readonly struct Complex64 { /// /// The real part of the complex number. /// public readonly float Real; /// /// The imaginary part of the complex number. /// public readonly float Imaginary; /// /// Initializes a new instance of the struct. /// /// The real part in the complex number. /// The imaginary part in the complex number. public Complex64(float real, float imaginary) { this.Real = real; this.Imaginary = imaginary; } /// /// Performs the multiplication operation between a instance and a scalar. /// /// The value to multiply. /// The scalar to use to multiply the value. /// The result. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Complex64 operator *(Complex64 value, float scalar) => new Complex64(value.Real * scalar, value.Imaginary * scalar); } }