Class FieldSinCos<T>

  • Type Parameters:
    T - the type of the field elements

    public class FieldSinCos<T>
    extends Object
    Holder for both sine and cosine values.

    This class is a simple container, it does not provide any computational method.

    Since:
    1.4
    See Also:
    FastMath.sinCos(org.hipparchus.CalculusFieldElement)
    • Constructor Detail

      • FieldSinCos

        public FieldSinCos​(T sin,
                           T cos)
        Simple constructor.
        Parameters:
        sin - value of the sine
        cos - value of the cosine
    • Method Detail

      • sin

        public T sin()
        Get the value of the sine.
        Returns:
        value of the sine
      • cos

        public T cos()
        Get the value of the cosine.
        Returns:
        value of the cosine
      • sum

        public static <S extends CalculusFieldElement<S>> FieldSinCos<S> sum​(FieldSinCos<S> scAlpha,
                                                                             FieldSinCos<S> scBeta)
        Compute sine and cosine of angles sum.
        Type Parameters:
        S - the type of the field elements
        Parameters:
        scAlpha - \((\sin \alpha, \cos \alpha)\)
        scBeta - \((\sin \beta, \cos \beta)\)
        Returns:
        \((\sin \alpha+\beta, \cos \alpha+\beta)\)
        Since:
        1.8
      • difference

        public static <S extends CalculusFieldElement<S>> FieldSinCos<S> difference​(FieldSinCos<S> scAlpha,
                                                                                    FieldSinCos<S> scBeta)
        Compute sine and cosine of angles difference.
        Type Parameters:
        S - the type of the field elements
        Parameters:
        scAlpha - \((\sin \alpha, \cos \alpha)\)
        scBeta - \((\sin \beta, \cos \beta)\)
        Returns:
        \((\sin \alpha+\beta, \cos \alpha-\beta)\)
        Since:
        1.8