Finding a point on a Bezier curve when given the distance from the start point
2016-08-03 17:53
99 查看
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
相关文章推荐
- Finding a Point on a Bézier Curve: De Casteljau's Algorithm
- RevitAPI: Rebar.CreateFromCurves抛出异常: Unable to create a RebarShape based on the given curves
- How to get the data from a cell when I click on the GridButtonColumn of the same row
- Finding a Point on a Bézier Curve: De Casteljau's Algorithm(转)
- When you copy large files to or from earlier operating systems, the copy operation may be slower than expected on some Windows Vista-based computers
- Solved this program:accessed from a thread other than the thread it was created on.
- Read the article "WindowsNT Buffer Overflow's From Start to Finish"
- using INSTR function for obtaining data from a table, based on a selection from the master table (FK relation)
- Unable to start debugging on the web server. Logon failure: unknown user name or bad password(web服务器无法启动调试:未知用户名或密码错误)
- [原]Unable to start debugging on the web server.Debugging failes because integrated Windows authentication is not enabled.
- Local workstation xampp/Eclipse PDT/xdebug on WinXP from start to end
- The Method OF Kill Given Process In Guest OS From VMM
- equivalence on the PILFERAGE by the wisemen from both ancient Orient and Occident
- Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500 解决办法
- 问题:Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath.Perhaps JAVA_HOME does not point to the JDK
- Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath.Perhaps JAVA_HOME does not point to the JDK
- Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK(转
- Refresh a GridView control on the parent page, from a pop up window
- Finding SQL Servers on the Network
- When you start the Distributed Transaction Coordinator service in Windows XP/Server 2003,you receive error -1-73737712(转载)