Jump to content
Sign in to follow this  

Calculating line length

Recommended Posts


Hi there,

does anyone know how to calculate the length of a line, given only the coordinates of it (x1,y1,x2,y2)?

For example, I know a line with following coordinates: x1 = 10; y1 = 10; x2 = 50; y2 = 100; and now i need a formula or a set of functions that will return me the length of that line.

I have a feeling that this is a ridiculously simple formula learned from school or something, but I'm just 7th grade. Any solutions would be welcome!!

Share this post

Link to post
Share on other sites

Hi and welcome to AutoIt forums

I know my question(s) probably sounds dumb and in others minds your question is logical....

But when you say line do you mean ..

A line of text in a an AutoIt control of sorts (ie: label, button, combobox.. etc)?

A graphic control line in an AutoIt gui?

An outline of a gui window of sorts?

A line of a graphic that's in non AutoIt gui?

A text line that's in non AutoIt gui?

A line in how long is a piece of string that has nothing to do with an AutoIt gui or any gui in general?

When you say x1 , y1, x2, y2 do you mean...

x1 = Horizontal starting point?

y1 = Vertical starting point?

x2 = Horizontal width?

y2 = Vertical Hieght?

Just knowing what your actually after would make answering shorter and easier for those that would like to help.

A bit more specific and someone could probably give the correct advice, formula or method to be more helpful to accomplish what your after.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this