Jump to content

colrectangles: how to?


Recommended Posts

Ho ho, i don't make a joke out of you. I never will.

Lets get it more complicated. I've made a rectangle in photoshop:

rectn.png

There are 5 points there:

1. left top

2. right top

3. left bottom

4. right bottom

5. center

Now, i want to know at what point i need to get x and the y. And how to math the width and depth. I hope that explains some more about my question.

Link to comment

Ho ho, i don't make a joke out of you. I never will.

Lets get it more complicated. I've made a rectangle in photoshop:

rectn.png

There are 5 points there:

1. left top

2. right top

3. left bottom

4. right bottom

5. center

Now, i want to know at what point i need to get x and the y. And how to math the width and depth. I hope that explains some more about my question.

Link to comment
As you said #"3. left bottom" (south-west -> X, Y). Width is distance between #3 and #4, depth is distance between #3 and #1 (or the other way around).

What do you want to calculate?

If i read good:

from position 3 i need to get the x coord

from position 4 i need to get the y coord

and from 3 to (x coord) 1 i can calculate the depth

and from 3 to 4 i can calculate the width

Am i right?

Link to comment
As you said #"3. left bottom" (south-west -> X, Y). Width is distance between #3 and #4, depth is distance between #3 and #1 (or the other way around).

What do you want to calculate?

If i read good:

from position 3 i need to get the x coord

from position 4 i need to get the y coord

and from 3 to (x coord) 1 i can calculate the depth

and from 3 to 4 i can calculate the width

Am i right?

Link to comment
As you said #"3. left bottom" (south-west -> X, Y). Width is distance between #3 and #4, depth is distance between #3 and #1 (or the other way around).

What do you want to calculate?

If i read good:

from position 3 i need to get the x coord

from position 4 i need to get the y coord

and from 3 to (x coord) 1 i can calculate the depth

and from 3 to 4 i can calculate the width

Am i right?

Of course you're wrong :?

Read it again.

TIP: A point has a location (x, y).

Link to comment
As you said #"3. left bottom" (south-west -> X, Y). Width is distance between #3 and #4, depth is distance between #3 and #1 (or the other way around).

What do you want to calculate?

If i read good:

from position 3 i need to get the x coord

from position 4 i need to get the y coord

and from 3 to (x coord) 1 i can calculate the depth

and from 3 to 4 i can calculate the width

Am i right?

Of course you're wrong :?

Read it again.

TIP: A point has a location (x, y).

Link to comment
Ahh, i think i got the point.

So i go to point #3 save the coords, that are the x and y coords.

Then i go from point #3 to #4 and then get the distance with the function getDistanceBetweenPoints2D that is the width.

Then i go from point #3 to #1 and with the same function i get the depth.

Am i right now? :)

Sort of. You don't have to use getDistanceBetweenPoints2D because you can't rotate colshapes, so rectangle has always straight line along X and Y axis.

Link to comment
Ahh, i think i got the point.

So i go to point #3 save the coords, that are the x and y coords.

Then i go from point #3 to #4 and then get the distance with the function getDistanceBetweenPoints2D that is the width.

Then i go from point #3 to #1 and with the same function i get the depth.

Am i right now? :)

Sort of. You don't have to use getDistanceBetweenPoints2D because you can't rotate colshapes, so rectangle has always straight line along X and Y axis.

Link to comment

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...