Linear Graphs
- တစ်ပြေးညီ
- ကုန်းစောင်း
- ကြားဖြတ်
တစ်ပြေးညီ
Linear ဆိုသည်မှာ ဖြောင့်သည်။ linear graph သည် မျဉ်းဖြောင့်တစ်ခုဖြစ်သည်။
ယေဘူယျအားဖြင့်၊ linear graph သည် function တန်ဖိုးများကိုပြသသည်။
ဥပမာ
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);
ကုန်းစောင်း
လျှောစောက် သည် ဂရပ်၏ထောင့်ဖြစ်သည် ။
slope သည် linear ဂရပ်တစ်ခုရှိတန်ဖိုး ဖြစ်သည်
y = a x
ဤဥပမာတွင်၊ slope = 1.2 :
ဥပမာ
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);
ကြားဖြတ်
Intercept သည် ဂရပ်၏ အစတန်ဖိုးဖြစ်သည် ။
ကြားဖြတ်သည် မျဉ်းကြောင်းဂရပ်တစ်ခုရှိ b တန်ဖိုးဖြစ်သည်။
y = ပုဆိန် + b
ဤဥပမာတွင်၊ slope = 1.2 နှင့် intercept = 2 :
ဥပမာ
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);