Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫  π  -¹ ² ³ °

You are not logged in.

## #1 2012-09-19 05:07:31

tina123
Member
Registered: 2012-04-29
Posts: 83

### get location or x ,y coordinates of mid point of width or height

i have a rectangle with height = 123 and width = 92. also i have central location x ,y = 47 , 62 .

I can find the mid  point of width and height of rectangle .
but i want to get location x ,y of mid point of width or height of rectangle .How  can i get that .
Can any one please tell me mathematically .
thanks

Offline

## #2 2012-09-19 05:17:46

bobbym
From: Bumpkinland
Registered: 2009-04-12
Posts: 107,115

### Re: get location or x ,y coordinates of mid point of width or height

Hi tina123;

In order to get the x,y coordinates of your rectangle it would have to located along the xy axis otherwise the center point of it will be different for each rectangle.

See the drawing below.

In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #3 2012-09-19 06:08:40

tina123
Member
Registered: 2012-04-29
Posts: 83

### Re: get location or x ,y coordinates of mid point of width or height

Well, we can find central  location of a rectangle .
let say we have x,y initiail corner of rectangle is 1,1 . width and height of rectangle is 92 and 23 .

so  cX = x + width/2 , cy =y+ height /2
that will give u central location of rectangle .
but how  can we get location of mid point of width or height  ?

Last edited by tina123 (2012-09-19 11:38:02)

Offline

## #4 2012-09-19 06:31:45

bobbym
From: Bumpkinland
Registered: 2009-04-12
Posts: 107,115

### Re: get location or x ,y coordinates of mid point of width or height

Hi;

To get the midpoint of a side you just add the coordinates and divide by 2. Same as for a line.

In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #5 2012-09-19 11:37:04

tina123
Member
Registered: 2012-04-29
Posts: 83

### Re: get location or x ,y coordinates of mid point of width or height

bobbym wrote:

Hi;

To get the midpoint of a side you just add the coordinates and divide by 2. Same as for a line.

i know the way to get the mid point . mid point will be single value .
i want mid point  location in x , y .
How can we get that  ?

Offline

## #6 2012-09-19 19:03:46

bobbym
From: Bumpkinland
Registered: 2009-04-12
Posts: 107,115

### Re: get location or x ,y coordinates of mid point of width or height

Hi;

Do you want the mid point of a side or of the rectangle?

In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #7 2012-09-20 23:50:51

tina123
Member
Registered: 2012-04-29
Posts: 83

### Re: get location or x ,y coordinates of mid point of width or height

bobbym wrote:

Hi;

Do you want the mid point of a side or of the rectangle?

yes , i mid point(int form of x ,y ) of a side of rectangle  .
thanks

Offline

## #8 2012-09-21 00:02:09

bobbym
From: Bumpkinland
Registered: 2009-04-12
Posts: 107,115

### Re: get location or x ,y coordinates of mid point of width or height

Since the sides of a rectangle are either horizontal or vertical lines you do this.

For a horizontal side with coordinates (x1,y1) and (x2,y2) the midpoint is

For a vertical side with coordinates (x1,y1) and (x2,y2) the midpoint is

In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #9 2012-09-21 00:53:02

tina123
Member
Registered: 2012-04-29
Posts: 83

### Re: get location or x ,y coordinates of mid point of width or height

Hy Dear Bobby,

Is that correct way to get the location in x,y of mid point of width and height ?
Thanks

Offline

## #10 2012-09-21 00:57:08

bobbym
From: Bumpkinland
Registered: 2009-04-12
Posts: 107,115

### Re: get location or x ,y coordinates of mid point of width or height

Hi tina123;

Those formulas are the correct way to get the midpoint ( the red marks ) of a side of a rectangle when you have the (x,y) coordinates of the vertices of the side.

Try it on one.

Do you need a little more to understand it?

In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline