Point3D: { x?: number; y?: number; z?: number }

Represents a point in 3D space with optional x, y, and z coordinates. Each coordinate is a number and is optional, allowing for partial definitions.

Type declaration

  • Optionalx?: number
  • Optionaly?: number
  • Optionalz?: number
// A point with all coordinates defined
const point: Point3D = { x: 10, y: 20, z: 30 };
// A point with only one coordinate defined
const point: Point3D = { x: 10 };
// Default values are undefined for all coordinates.
const point: Point3D = {};