Advertisement
nedjo

Point3D

Jan 24th, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _1_Point3D
  4. {
  5. class Point3D
  6. {
  7. private double x;
  8. private double y;
  9. private double z;
  10. private static readonly Point3D startingPoint;
  11.  
  12. static Point3D()
  13. {
  14. startingPoint = new Point3D(0, 0, 0);
  15. }
  16.  
  17. public Point3D(double x, double y, double z)
  18. {
  19. this.X = x;
  20. this.Y = y;
  21. this.Z = z;
  22. }
  23.  
  24. public double X
  25. {
  26. get { return this.x; }
  27. set { this.x = value; }
  28. }
  29.  
  30. public double Y
  31. {
  32. get { return this.y; }
  33. set { this.y = value; }
  34. }
  35.  
  36. public double Z
  37. {
  38. get { return this.z; }
  39. set { this.z = value; }
  40. }
  41.  
  42. public override string ToString()
  43. {
  44. return String.Format("{0}, {1}, {2}", this.x, this.y, this.z);
  45. }
  46.  
  47. public static Point3D StartingPoint
  48. {
  49. get
  50. {
  51. return Point3D.startingPoint;
  52. }
  53. }
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement