Class VMath

java.lang.Object
de.linusdev.lutils.math.VMath

public class VMath extends Object
  • Method Details

    • equals

      public static boolean equals(@NotNull @NotNull FloatN vector, float @NotNull [] data, float epsilon)
      Parameters:
      vector - FloatN
      data - a vector as float array
      epsilon - the maximum difference between each component. 0.0 for true equality
      Returns:
      true if the difference of each component of vector and data is equal or smaller than epsilon.
    • equals

      public static boolean equals(@NotNull @NotNull FloatN vector, @NotNull @NotNull FloatN other, float epsilon)
      Parameters:
      vector - FloatN
      other - FloatN to compare
      epsilon - the maximum difference between each component. 0.0 for true equality
      Returns:
      true if the difference of each component of vector and data is equal or smaller than epsilon.
    • equals

      public static boolean equals(@NotNull @NotNull FloatMxN matrix, float @NotNull [] data, float epsilon)
      Parameters:
      matrix - FloatMxN
      data - a matrix as float array
      epsilon - the maximum difference between each component. 0.0 for true equality
      Returns:
      true if the difference of each component of matrix and data is equal or smaller than epsilon.
    • equals

      public static boolean equals(@NotNull @NotNull FloatMxN matrix, @NotNull @NotNull FloatMxN other, float epsilon)
      Parameters:
      matrix - FloatMxN
      other - FloatMxN to compare
      epsilon - the maximum difference between each component. 0.0 for true equality
      Returns:
      true if the difference of each component of matrix and data is equal or smaller than epsilon.
    • add

      @Contract("_, _, _ -> param3") @NotNull public static <V extends FloatN> V add(@NotNull V left, @NotNull V right, @UniqueView @NotNull V store)
    • subtract

      @Contract("_, _, _ -> param3") @NotNull public static <V extends FloatN> V subtract(@NotNull V left, @NotNull V right, @UniqueView @NotNull V store)
    • multiply

      @Contract("_, _, _ -> param3") @NotNull public static <V extends FloatN> V multiply(@NotNull V left, @NotNull V right, @UniqueView @NotNull V store)
    • divide

      @Contract("_, _, _ -> param3") @NotNull public static <V extends FloatN> V divide(@NotNull V left, @NotNull V right, @UniqueView @NotNull V store)
    • scale

      @Contract("_, _, _ -> param3") @NotNull public static <V extends FloatN> V scale(@NotNull V toScale, float factor, @UniqueView @NotNull V store)
    • dot

      public static float dot(@NotNull @NotNull FloatN left, @NotNull @NotNull FloatN right)
    • length

      public static float length(@NotNull @NotNull FloatN vector)
    • cross

      @Contract("_, _, _ -> param3") @NotNull public static @NotNull Float3 cross(@NotNull @NotNull Float3 left, @NotNull @NotNull Float3 right, @NotNull @NotNull Float3 store)
    • normalize

      @Contract("_, _ -> param2") @NotNull public static <V extends FloatN> V normalize(@NotNull V toNormalize, @UniqueView @NotNull V store)
    • scale

      @Contract("_, _, _ -> param3") @NotNull public static <M extends FloatMxN> M scale(@NotNull M toScale, float factor, @UniqueView @NotNull M store)
    • determinant

      public static float determinant(@NotNull @NotNull Float4x4 mat)
    • adjugate

      @Contract("_, _ -> param2") @NotNull public static @NotNull Float4x4 adjugate(@NotNull @NotNull Float4x4 mat, @Unique @NotNull @NotNull Float4x4 store)
    • inverse

      @Contract("_, _ -> param2") @NotNull public static @NotNull Float4x4 inverse(@NotNull @NotNull Float4x4 mat, @Unique @NotNull @NotNull Float4x4 store)
    • multiply

      @Contract("_, _, _ -> param3") @NotNull public static @NotNull Float4 multiply(@NotNull @NotNull Float4x4 left, @NotNull @NotNull Float4 right, @NotNull @NotNull Float4 store)
    • multiply

      @Contract("_, _, _ -> param3") @NotNull public static @NotNull Float3 multiply(@NotNull @NotNull Float3x3 left, @NotNull @NotNull Float3 right, @NotNull @NotNull Float3 store)
    • uniqueViewVector

      protected static boolean uniqueViewVector(@NotNull @NotNull Vector unique, @NotNull @NotNull Vector @NotNull ... vectors)
      Checks if no Vector in vectors is a view on unique. Or if unique itself is a view, that unique is not a view on any vector in vectors. Views with a non-special mapping are allowed.
      Parameters:
      unique - vector which should be checked if it is unique (view wise)
      vectors - array of vectors
      Returns:
      true if no vector in vectors is a view on unique