Lineaire grafieken

  • Lineair
  • Helling
  • Onderscheppen

Lineair

Lineair betekent recht. Een lineaire grafiek is een rechte lijn.

Over het algemeen geeft een lineaire grafiek functiewaarden weer.

Voorbeeld

var xValues = [];
var yValues = [];

// Generate values
for (var x = 0; x <= 10; x += 1) {
  xValues.push(x);
  yValues.push(x);
}

// Display using Plotly
var data = [{
  x: xValues,
  y: yValues,
  mode: "lines"
}];

// Define Layout
var layout = {title: "y = x"};
// Display using Plotly
Plotly.newPlot("myPlot", data, layout);

Helling

De helling is de hoek van de grafiek.

De helling is de a -waarde in een lineaire grafiek:

y = een x

In dit voorbeeld is helling = 1,2 :

Voorbeeld

var slope = 1.2;
var xValues = [];
var yValues = [];

// Generate values
for (var x = 0; x <= 10; x += 1) {
  xValues.push(x);
  yValues.push(x * slope);
}

// Define Data
var data = [{
  x: xValues,
  y: yValues,
  mode: "lines"
}];
// Define Layout
var layout = {title: "Slope=" + slope};

// Display using Plotly
Plotly.newPlot("myPlot", data, layout);

Onderscheppen

Het snijpunt is de startwaarde van de grafiek.

Het snijpunt is de b- waarde in een lineaire grafiek:

y = ax + b

In dit voorbeeld is helling = 1,2 en snijpunt = 2 :

Voorbeeld

var slope = 1.2;
var intercept = 7;
var xValues = [];
var yValues = [];

// Generate values
for (var x = 0; x <= 10; x += 1) {
  xValues.push(x);
  yValues.push(x * slope + intercept);
}

// Define Data
var data = [{
  x: xValues,
  y: yValues,
  mode: "lines"
}];

// Define Layout
var layout = {title: "Slope=" + slope + " Intercept=" + intercept};

// Display using Plotly
Plotly.newPlot("myPlot", data, layout);