001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017 package org.apache.commons.math3.geometry.euclidean.threed;
018
019
020 /** Simple container for a two-points segment.
021 * @version $Id: Segment.java 1416643 2012-12-03 19:37:14Z tn $
022 * @since 3.0
023 */
024 public class Segment {
025
026 /** Start point of the segment. */
027 private final Vector3D start;
028
029 /** End point of the segments. */
030 private final Vector3D end;
031
032 /** Line containing the segment. */
033 private final Line line;
034
035 /** Build a segment.
036 * @param start start point of the segment
037 * @param end end point of the segment
038 * @param line line containing the segment
039 */
040 public Segment(final Vector3D start, final Vector3D end, final Line line) {
041 this.start = start;
042 this.end = end;
043 this.line = line;
044 }
045
046 /** Get the start point of the segment.
047 * @return start point of the segment
048 */
049 public Vector3D getStart() {
050 return start;
051 }
052
053 /** Get the end point of the segment.
054 * @return end point of the segment
055 */
056 public Vector3D getEnd() {
057 return end;
058 }
059
060 /** Get the line containing the segment.
061 * @return line containing the segment
062 */
063 public Line getLine() {
064 return line;
065 }
066
067 }