Size of Line

I am making a pool game, very similar to Miniclip’s 8 Ball Pool, if you have ever played that. Basically, I need to find a way to measure the size of a line. Lines are drawn in Codea with two points, two x variables and two y variables, and I was wondering what equation I should use. This line’s visual size is always changing, as it is drawn from a set point on the screen, to whatever point you are touching on the screen. Am I missing something huge here and am being an idiot, or should I try using something like Pythagorean equation? Please, any input would be great. To sum up, a need a single number that determines a line’s size.

If the start and end points of the line are stored as vec2s, use the dist command.


p1 = vec2(50,50)
p2 = vec2(100,100)
line(p1.x, p1.y, p2.x, p2.y)
lineLength = p1:dist(p2)