I'm trying to draw a curve.
But I do not know how to draw the point y, we ask for help.

int matWidth = 500;
int matHeight = 500;
int fromPointX = 50;
int fromPointY = 400;
int toPointX = 300;
int toPointY = 200;
ArrayList pointList = new ArrayList();
for(int i = fromPointX; i < toPointX; i++) {
Point point = new Point();
point.x = i;
// I do not know how to draw a curve.
point.y = fromPointY++;
pointList.add(point);
}
for(int i = 1; i < pointList.size(); i++) {
Core.line(mat, pointList.get(i-1), pointList.get(i),new Scalar(255,255,0), 5);
}
↧