The Center
property of the Line
struct provides the midpoint between the start and end points of the line. This property is useful for determining the central position of the line in 3D space.
The Center
property of the Line
struct provides the midpoint between the start and end points of the line. This property is useful for determining the central position of the line in 3D space.
To access the Center
property, you need to have an instance of the Line
struct. The property is read-only and returns a Vector3
representing the midpoint of the line.
// Example of using the Center property Line line = new Line { Start = new Vector3(0, 0, 0), End = new Vector3(10, 10, 10) }; Vector3 center = line.Center; // center will be (5, 5, 5)