Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace GeometryTasks
  8. {
  9. public class Vector
  10. {
  11. public double X;
  12. public double Y;
  13. }
  14. public static class Geometry
  15. {
  16. public static double GetLength(Vector a)
  17. {
  18. return Math.Sqrt(a.X * a.X + a.Y * a.Y);
  19. }
  20. public static Vector Add( Vector a, Vector b)
  21. {
  22. return new Vector { X = a.X + b.X, Y = a.Y + b.Y } ;
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement