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.geometry.euclidean;
018
019import org.apache.commons.geometry.core.Transform;
020
021/** Interface representing affine transforms in Euclidean space. An affine transform is one that preserves
022 * points, straight lines, planes, and sets of parallel lines. Common affine transforms include translation,
023 * rotation, scaling, reflection and any compositions thereof.
024 *
025 * @param <V> Vector implementation type
026 * @see <a href="https://en.wikipedia.org/wiki/Affine_transformation">Affine Transformation</a>
027 */
028public interface EuclideanTransform<V extends EuclideanVector<V>> extends Transform<V> {
029
030    /** Apply this transform to the given vector, ignoring translations.
031    *
032    * <p>This method can be used to transform vector instances representing displacements between points.
033    * For example, if {@code v} represents the difference between points {@code p1} and {@code p2},
034    * then {@code transform.applyVector(v)} will represent the difference between {@code p1} and {@code p2}
035    * after {@code transform} is applied.
036    * </p>
037    *
038    * @param vec the vector to transform
039    * @return the new, transformed vector
040    */
041    V applyVector(V vec);
042}