-
-
Notifications
You must be signed in to change notification settings - Fork 836
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #275 from sk89q/linecurve
//line and //curve by @orthoplex64
- Loading branch information
Showing
7 changed files
with
970 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
src/main/java/com/sk89q/worldedit/interpolation/Interpolation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// $Id$ | ||
/* | ||
* WorldEditLibrary | ||
* Copyright (C) 2010 sk89q <http://www.sk89q.com> and contributors | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package com.sk89q.worldedit.interpolation; | ||
|
||
import java.util.List; | ||
|
||
import com.sk89q.worldedit.Vector; | ||
|
||
/** | ||
* Represents an arbitrary function in ℝ → ℝ<sup>3</sup> | ||
* | ||
* @author TomyLobo | ||
* | ||
*/ | ||
public interface Interpolation { | ||
/** | ||
* Sets nodes to be used by subsequent calls to | ||
* {@link #getPosition(double)} and the other methods. | ||
* | ||
* @param nodes | ||
*/ | ||
public void setNodes(List<Node> nodes); | ||
|
||
/** | ||
* Gets the result of f(position) | ||
* | ||
* @param position | ||
* @return | ||
*/ | ||
public Vector getPosition(double position); | ||
|
||
/** | ||
* Gets the result of f'(position). | ||
* | ||
* @param position | ||
* @return | ||
*/ | ||
public Vector get1stDerivative(double position); | ||
|
||
/** | ||
* Gets the result of ∫<sub>a</sub><sup style="position: relative; left: -1ex">b</sup>|f'(t)| dt.<br /> | ||
* That means it calculates the arc length (in meters) between positionA | ||
* and positionB. | ||
* | ||
* @param positionA lower limit | ||
* @param positionB upper limit | ||
* @return | ||
*/ | ||
double arcLength(double positionA, double positionB); | ||
|
||
int getSegment(double position); | ||
} |
Oops, something went wrong.