pointscart#

[xpoints, ypoints, distxy] = pointscart(x1, y1, x2, y2, nmidpoints, dispout)

Description#

Generate points between point (x1,y1) and (x2,y2) on cartesian coordinate

Inputs#

x1

x of start point (first point)

y1

y of start point (first point)

x2

x of end point (last point)

y2

y of end point (last point)

nmidpoints=1;
Number of middle points generated between first point and last point
nmidpoints=1;: 1 point between first point and last point is generated
dispout=’no’;

Define to display outputs or not (‘yes’: display, ‘no’: not display)

Outputs#

xpoint
x of points from (x1,y1) and (x2,y2)
x1 and x2 are included, total number of points are nmidpoints+2
ypoint
y of points from (x1,y1) and (x2,y2)
y1 and y2 are included, total number of points are nmidpoints+2
distxy

Distance at each points of (xpoint,ypoint) from the first point of (x1,y1)

Examples#

x1=-3;
y1=-3;
x2=3;
y2=3;
[xpoints,ypoints,distxy]=pointscart(x1,y1,x2,y2,10,'yes');

References#