Finding a point on a Bezier curve when given the distance from the start point
来源:互联网 发布:极致软件官网 编辑:程序博客网 时间:2024/06/05 09:26
Vector vector= new Vector();for (double t = 0.00; t < 1.001; t= t + .001) { double xValue = Math.pow((1 - t), 3) * p0.x + 3 * Math.pow((1 - t), 2) * t * p1.x + 3 * (1 - t) * Math.pow(t, 2) * p2.x + Math.pow(t, 3) * p3.x; double yValue = Math.pow((1 - t), 3) * p0.y + 3 * Math.pow((1 - t), 2) * t * p1.y + 3 * (1 - t) * Math.pow(t, 2) * p2.y + Math.pow(t, 3) * p3.y; v temp = new v(xValue, yValue); vector.add(temp);}double xPos = Math.abs(Math.pow((1 - percenttraveled), 3)) * p0.x + 3 * Math.pow((1 - percenttraveled), 2) * percenttraveled * p1.x + 3 * Math.abs((1 - percenttraveled)) * Math.pow(percenttraveled, 2) * p2.x + Math.abs(Math.pow(percenttraveled, 3)) * p3.x;double yPos = Math.abs(Math.pow((1 - percenttraveled), 3)) * p0.x + 3 * Math.pow((1 - percenttraveled), 2) * percenttraveled * p1.y + 3 * Math.abs((1 - percenttraveled)) * Math.pow(percenttraveled, 2) * p2.y + Math.abs(Math.pow(percenttraveled, 3)) * p4.y;
来自:http://stackoverflow.com/questions/7801628/finding-a-point-on-a-b%c3%a9zier-curve-when-given-the-distance-from-the-start-point
http://antigrain.com/research/adaptive_bezier/#toc0003
https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/math/Bezier.java
http://www.java2s.com/Code/Java/2D-Graphics-GUI/Interpolatesgivenpointsbyabeziercurve.htm
http://steve.hollasch.net/cgindex/curves/cbezarclen.html
0 0
- Finding a point on a Bezier curve when given the distance from the start point
- Finding a Point on a Bézier Curve: De Casteljau's Algorithm(转)
- Finding a Point on a Bézier Curve: De Casteljau's Algorithm
- A. Point on Spiral
- Get the window data(lamda,flux, true) from a center point and the window width
- a weird result when I try to print the value of point by %p format
- K closest points to a given point
- max-point-on-a-line
- Add a point on a map
- Vector3.Lerp(When t = 0 returns a. When t = 1 returns b. When t = 0.5 returns the point midway betw)
- Calculating The Logical Height and Point Size of a Font
- Calculating The Logical Height and Point Size of a Font
- Find closest point on a Linestring to another point
- 1396 - Most Distant Point from the Sea
- POJ3525-Most Distant Point from the Sea
- uva1396 Most Distant Point from the Sea
- POJ3525 Most Distant Point from the Sea
- Most Distant Point from the Sea POJ
- HDU 3410Passing the Message
- POJ 2429 关于gcd和lcm的逆求
- 前台js传入json或map类型数据给后台以及后台java接收操作
- Android性能优化开篇
- Codeforces Round #355 (Div. 2)C. Vanya and Label
- Finding a point on a Bezier curve when given the distance from the start point
- MFC中串口通信的编程
- Java基础课程-面向对象
- IntelliJ IDEA 环境常用设置整理
- myeclipse中java注释格式设置
- Integer和Int比较的种种猫腻
- 继承中类的 初始化顺序
- 各种整型的取值范围
- android 硬件加速带来的问题