SRFFloatExtensions.cs 459 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using UnityEngine;
  3. namespace SRF
  4. {
  5. public static class SRFFloatExtensions
  6. {
  7. public static float Sqr(this float f)
  8. {
  9. return f * f;
  10. }
  11. public static float SqrRt(this float f)
  12. {
  13. return Mathf.Sqrt(f);
  14. }
  15. public static bool ApproxZero(this float f)
  16. {
  17. return Mathf.Approximately(0f, f);
  18. }
  19. public static bool Approx(this float f, float f2)
  20. {
  21. return Mathf.Approximately(f, f2);
  22. }
  23. }
  24. }