View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      https://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  /*
19   * This is not the original file distributed by the Apache Software Foundation
20   * It has been modified by the Hipparchus project
21   */
22  package org.hipparchus.geometry.partitioning;
23  
24  import org.hipparchus.geometry.Point;
25  import org.hipparchus.geometry.Space;
26  
27  
28  /** This interface represents an inversible affine transform in a space.
29   * <p>Inversible affine transform include for example scalings,
30   * translations, rotations.</p>
31  
32   * <p>Transforms are dimension-specific. The consistency rules between
33   * the three {@code apply} methods are the following ones for a
34   * transformed defined for dimension D:</p>
35   * <ul>
36   *   <li>
37   *     the transform can be applied to a point in the
38   *     D-dimension space using its {@link #apply(Point)}
39   *     method
40   *   </li>
41   *   <li>
42   *     the transform can be applied to a (D-1)-dimension
43   *     hyperplane in the D-dimension space using its
44   *     {@link #apply(Hyperplane)} method
45   *   </li>
46   *   <li>
47   *     the transform can be applied to a (D-2)-dimension
48   *     sub-hyperplane in a (D-1)-dimension hyperplane using
49   *     its {@link #apply(SubHyperplane, Hyperplane, Hyperplane)}
50   *     method
51   *   </li>
52   * </ul>
53  
54   * @param <S> Type of the embedding space.
55   * @param <T> Type of the embedded sub-space.
56  
57   */
58  public interface Transform<S extends Space, T extends Space> {
59  
60      /** Transform a point of a space.
61       * @param point point to transform
62       * @return a new object representing the transformed point
63       */
64      Point<S> apply(Point<S> point);
65  
66      /** Transform an hyperplane of a space.
67       * @param hyperplane hyperplane to transform
68       * @return a new object representing the transformed hyperplane
69       */
70      Hyperplane<S> apply(Hyperplane<S> hyperplane);
71  
72      /** Transform a sub-hyperplane embedded in an hyperplane.
73       * @param sub sub-hyperplane to transform
74       * @param original hyperplane in which the sub-hyperplane is
75       * defined (this is the original hyperplane, the transform has
76       * <em>not</em> been applied to it)
77       * @param transformed hyperplane in which the sub-hyperplane is
78       * defined (this is the transformed hyperplane, the transform
79       * <em>has</em> been applied to it)
80       * @return a new object representing the transformed sub-hyperplane
81       */
82      SubHyperplane<T> apply(SubHyperplane<T> sub, Hyperplane<S> original, Hyperplane<S> transformed);
83  
84  }