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 <T> Type of the embedded sub-space. 51 52 * @see Hyperplane 53 */ 54 public interface Embedding<S extends Space, T extends Space> { 55 56 /** Transform a space point into a sub-space point. 57 * @param point n-dimension point of the space 58 * @return (n-1)-dimension point of the sub-space corresponding to 59 * the specified space point 60 * @see #toSpace 61 */ 62 Point<T> toSubSpace(Point<S> point); 63 64 /** Transform a sub-space point into a space point. 65 * @param point (n-1)-dimension point of the sub-space 66 * @return n-dimension point of the space corresponding to the 67 * specified sub-space point 68 * @see #toSubSpace 69 */ 70 Point<S> toSpace(Point<T> point); 71 72 }