Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _1.Point3D
- {
- class Point3D
- {
- private static readonly Point3D origin;
- private double xCoordinate;
- private double yCoordinate;
- private double zCoordinate;
- static Point3D()
- {
- origin = new Point3D(0, 0, 0);
- }
- public Point3D(double x, double y, double z)
- {
- this.XCoordinate = x;
- this.YCoordinate = y;
- this.ZCoordinate = z;
- }
- public static Point3D Origin
- {
- get { return Point3D.origin; }
- }
- public double XCoordinate
- {
- get { return xCoordinate; }
- set { xCoordinate = value; }
- }
- public double YCoordinate
- {
- get { return yCoordinate; }
- set { yCoordinate = value; }
- }
- public double ZCoordinate
- {
- get { return zCoordinate; }
- set { zCoordinate = value; }
- }
- public override string ToString()
- {
- string pointCoordinates = String.Format("X: {0}, Y: {1}, Z: {2}", this.xCoordinate, this.yCoordinate, this.zCoordinate);
- return pointCoordinates;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement