<< NL_F_Line NL_F: Function NL_F_LinePoint >>

NARVAL >> NL_F: Function > NL_F_Line2Points

NL_F_Line2Points

Compute the slope and y-intercept of a line defined by two points.

Calling Sequence

[a,b] = NL_F_Line2Points(x1,y1,x2,y2)

Arguments

x1 :

x-coordinate of the first point.

y1 :

y-coordinate of the first point.

x2 :

x-coordinate of the second point.

y2 :

y-coordinate of the second point.

a :

Slope.

b :

y-intercept.

Description

NL_F_Line2Points computes the slope a and y-intercept b of the line defined by the points of coordinates (x1,y1) and (x2,y2). The line is defined by y=a.x+b. If y1=y2, then a=[] and b=[]. The line is defined by y=y1.

Examples

x1=100;
y1=100;
x2=200;
y2=200;
[a,b]=NL_F_Line2Points(x1,y1,x2,y2);//application of NL_F_Line2Points

Report an issue
<< NL_F_Line NL_F: Function NL_F_LinePoint >>