Points on a line in jfreechart

ぐ巨炮叔叔 提交于 2019-11-28 09:48:32

问题


How to get all the points (x,y) lying on the line connecting two data-points in a chart in jfreechart ?.

In a chart, as we point to the end-points of the line, it shows the x & y coordinates. Can't we get the coordinates at any point on the line (via code)?


回答1:


As you have two points, use the formulae of a linear equation to obtain the slope and intercept of the line. Once you have the equation, you can evaluate it at any point.

Addendum: The org.jfree.data.statistics.Regression class offers some built-in support for regression analysis.



来源:https://stackoverflow.com/questions/10086306/points-on-a-line-in-jfreechart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!