Guest User

Untitled

a guest
Aug 5th, 2025
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. using System;
  2.  
  3. public class Program
  4. {
  5. public static void Main()
  6. {
  7. Vector2 pos = new Vector2(34.44f, 43.122244f);
  8. Vector2 move = new Vector2(4.5f, -4.5f);
  9. float speed = 4f;
  10. float deltaTime = 0.244355521f;
  11.  
  12. for (int i = 0; i < 100000000; i++)
  13. {
  14. Vector2 res = pos + (speed * deltaTime * move);
  15. //Vector2 res = pos + (move * speed * deltaTime);
  16. }
  17. }
  18. }
  19.  
  20. public struct Vector2
  21. {
  22. public float x;
  23. public float y;
  24.  
  25. public Vector2(float xx, float yy)
  26. {
  27. x = xx;
  28. y = yy;
  29. }
  30.  
  31. public static Vector2 operator +(Vector2 left, Vector2 right) => new Vector2(left.x + right.x, left.y + right.y);
  32. public static Vector2 operator *(Vector2 left, float right) => new Vector2(left.x * right, left.y * right);
  33. public static Vector2 operator *(float left, Vector2 right) => new Vector2(left * right.x, left * right.y);
  34. }
Advertisement
Add Comment
Please, Sign In to add comment