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 /** This interface defines mappers between a space and one of its sub-spaces.
28
29 * <p>Sub-spaces are the lower dimensions subsets of a n-dimensions
30 * space. The (n-1)-dimension sub-spaces are specific sub-spaces known
31 * as {@link Hyperplane hyperplanes}. This interface can be used regardless
32 * of the dimensions differences. As an example, {@link
33 * org.hipparchus.geometry.euclidean.threed.Line Line} in 3D
34 * implements Embedding< {@link
35 * org.hipparchus.geometry.euclidean.threed.Vector3D Vector3D}, {@link
36 * org.hipparchus.geometry.euclidean.oned.Vector1D Vector1D}>, i.e. it
37 * maps directly dimensions 3 and 1.</p>
38
39 * <p>In the 3D euclidean space, hyperplanes are 2D planes, and the 1D
40 * sub-spaces are lines.</p>
41
42 * <p>
43 * Note that this interface is <em>not</em> intended to be implemented
44 * by Hipparchus users, it is only intended to be implemented
45 * within the library itself. New methods may be added even for minor
46 * versions, which breaks compatibility for external implementations.
47 * </p>
48
49 * @param <S> Type of the embedding space.
50 * @param <P> Type of the points in the embedding space.
51 * @param <T> Type of the embedded sub-space.
52 * @param <Q> Type of the points in the embedded sub-space.
53
54 * @see Hyperplane
55 */
56 public interface Embedding<S extends Space, P extends Point<S, P>,
57 T extends Space, Q extends Point<T, Q>> {
58
59 /** Transform a space point into a sub-space point.
60 * @param point n-dimension point of the space
61 * @return (n-1)-dimension point of the sub-space corresponding to
62 * the specified space point
63 * @see #toSpace
64 */
65 Q toSubSpace(P point);
66
67 /** Transform a sub-space point into a space point.
68 * @param point (n-1)-dimension point of the sub-space
69 * @return n-dimension point of the space corresponding to the
70 * specified sub-space point
71 * @see #toSubSpace
72 */
73 P toSpace(Q point);
74
75 }