Author Topic: How to find the equation of a line from two points  (Read 263 times)

Offline GalChazar

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
How to find the equation of a line from two points
« on: February 05, 2012, 04:02:32 PM »
Hi, I want to draw a straight line through two points in the coopdinate system (fx. through (3,8) and (6,6)). This guide www.essentialmaths.com.au/student/files/Std_Gen/StdGen_Chapter3.pdf exlains how to do it on a TI-Nspire CAS, but I can't seem to figure out how to do it in PocketCAS. Can anyone help me?

Offline MrMage

  • Administrator
  • *****
  • Posts: 475
  • Karma: 7
Re: How to find the equation of a line from two points
« Reply #1 on: February 05, 2012, 04:21:47 PM »
Have a look at the linear_regression() function.

Offline GalChazar

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: How to find the equation of a line from two points
« Reply #2 on: February 05, 2012, 05:53:23 PM »
I have tried:
linear_regression([3.0,8.0],[6.0,6.0])
But when I click Go and then Plot nothing happens.

I've also tried to simply write:
[3.0,6.0],[8.0,6.0]
But when I click Go and then Plot it draws a straight line with end points in 3,8 and 6,6, instead of an infinitely long line passing through 3,8 and 6,6 as I would like.

Offline MrMage

  • Administrator
  • *****
  • Posts: 475
  • Karma: 7
Re: How to find the equation of a line from two points
« Reply #3 on: February 05, 2012, 05:55:19 PM »
Enter
Code: [Select]
linear_regression([[3.0,8.0],[6.0,6.0]])and press 'Go!'. Then read the slope and the offset of the line from the resulting array.

Or enter
Code: [Select]
A:=linear_regression([[3.0,8.0],[6.0,6.0]])and press 'Go!'. Then just plot
Code: [Select]
A[0]*x+A[1].