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 */
017package org.apache.commons.math3.geometry.euclidean.threed;
018
019
020/** Simple container for a two-points segment.
021 * @since 3.0
022 */
023public class Segment {
024
025    /** Start point of the segment. */
026    private final Vector3D start;
027
028    /** End point of the segments. */
029    private final Vector3D end;
030
031    /** Line containing the segment. */
032    private final Line     line;
033
034    /** Build a segment.
035     * @param start start point of the segment
036     * @param end end point of the segment
037     * @param line line containing the segment
038     */
039    public Segment(final Vector3D start, final Vector3D end, final Line line) {
040        this.start  = start;
041        this.end    = end;
042        this.line   = line;
043    }
044
045    /** Get the start point of the segment.
046     * @return start point of the segment
047     */
048    public Vector3D getStart() {
049        return start;
050    }
051
052    /** Get the end point of the segment.
053     * @return end point of the segment
054     */
055    public Vector3D getEnd() {
056        return end;
057    }
058
059    /** Get the line containing the segment.
060     * @return line containing the segment
061     */
062    public Line getLine() {
063        return line;
064    }
065
066}