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 origin space.
55 * @param <P> Type of the points in the origin space.
56 * @param <H> Type of the hyperplane in the origin space.
57 * @param <I> Type of the sub-hyperplane in the origin space.
58 * @param <T> Type of the destination sub-space.
59 * @param <Q> Type of the points in the destination sub-space.
60 * @param <F> Type of the hyperplane in the destination sub-space.
61 * @param <J> Type of the sub-hyperplane in the destination sub-space.
62
63 */
64 public interface Transform<S extends Space,
65 P extends Point<S, P>,
66 H extends Hyperplane<S, P, H, I>,
67 I extends SubHyperplane<S, P, H, I>,
68 T extends Space,
69 Q extends Point<T, Q>,
70 F extends Hyperplane<T, Q, F, J>,
71 J extends SubHyperplane<T, Q, F, J>> {
72
73 /** Transform a point of a space.
74 * @param point point to transform
75 * @return a new object representing the transformed point
76 */
77 P apply(P point);
78
79 /** Transform an hyperplane of a space.
80 * @param hyperplane hyperplane to transform
81 * @return a new object representing the transformed hyperplane
82 */
83 H apply(H hyperplane);
84
85 /** Transform a sub-hyperplane embedded in an hyperplane.
86 * @param sub sub-hyperplane to transform
87 * @param original hyperplane in which the sub-hyperplane is
88 * defined (this is the original hyperplane, the transform has
89 * <em>not</em> been applied to it)
90 * @param transformed hyperplane in which the sub-hyperplane is
91 * defined (this is the transformed hyperplane, the transform
92 * <em>has</em> been applied to it)
93 * @return a new object representing the transformed sub-hyperplane
94 */
95 J apply(J sub, H original, H transformed);
96
97 }