### Author Topic: Math/geometry Question  (Read 496 times)

0 Members and 1 Guest are viewing this topic.

#### Sandwich

• Got Screen?
• 212
##### Math/geometry Question
I'm trying to figure out SVG hexagons. I want to find some size values that result in integers. I know that the height of a hexagon is height = sqrt(3)/2 * width. I'd like 'height' and 'width' to be integers.

So the question is, can the square root of 3, divided by 2, be multiplied by some integer to result in another integer?
SERIOUSLY...! | {The Sandvich Bar} - Rhino-FS2 Tutorial | CapShip Turret Upgrade | The Complete FS2 Ship List | System Background Package

"...The quintessential quality of our age is that of dreams coming true. Just think of it. For centuries we have dreamt of flying; recently we made that come true: we have always hankered for speed; now we have speeds greater than we can stand: we wanted to speak to far parts of the Earth; we can: we wanted to explore the sea bottom; we have: and so  on, and so on: and, too, we wanted the power to smash our enemies utterly; we have it. If we had truly wanted peace, we should have had that as well. But true peace has never been one of the genuine dreams - we have got little further than preaching against war in order to appease our consciences. The truly wishful dreams, the many-minded dreams are now irresistible - they become facts." - 'The Outward Urge' by John Wyndham

"The very essence of tolerance rests on the fact that we have to be intolerant of intolerance. Stretching right back to Kant, through the Frankfurt School and up to today, liberalism means that we can do anything we like as long as we don't hurt others. This means that if we are tolerant of others' intolerance - especially when that intolerance is a call for genocide - then all we are doing is allowing that intolerance to flourish, and allowing the violence that will spring from that intolerance to continue unabated." - Bren Carlill

#### The E

• He's Ebeneezer Goode
• Global Moderator
• 213
• Nothing personal, just tech support.
##### Re: Math/geometry Question

Slightly longer answer: Given that sqrt(3) is an irrational number, no integer exists that, when multiplied by sqrt(3), results in another integer.
**** every cause that ends in murder and children crying. ― Iain Banks
Join the fun at the HLP IRC channel. Get the latest spam and gossip as long as it's fresh!

#### Phantom Hoover

• 211
##### Re: Math/geometry Question
Longer answer still: no, and you can't trisect the angle on its corner with a straightedge and compass either.
The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell.

#### GhylTarvoke

• 26
##### Re: Math/geometry Question
No integer except zero.

#### Bobboau

• Just a MODern kinda guy
Just MODerately cool
And MODest too
• 213
##### Re: Math/geometry Question
You know... I didn't see a constraint about this needing to be a regular hexagon.
You can just squish the thing to be any integer in any direction you want.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3

DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

#### Kobrar44

• On Suspended Sentence
• 29
• Let me tilerape it for you!
##### Re: Math/geometry Question
Well, floating point numbers only have like 8 digit precision, and double 15-16 so some 9 or 17+ digit integer should work for whatever you need that, and 64bit type has 19 IIRC.
Oh guys, use that [ url ][ img ][ /img ][ /url ] :/

#### The E

• He's Ebeneezer Goode
• Global Moderator
• 213
• Nothing personal, just tech support.
##### Re: Math/geometry Question
Are you volunteering to search that number space for possible solutions?
**** every cause that ends in murder and children crying. ― Iain Banks
Join the fun at the HLP IRC channel. Get the latest spam and gossip as long as it's fresh!

#### Phantom Hoover

• 211
##### Re: Math/geometry Question
Well, floating point numbers only have like 8 digit precision, and double 15-16 so some 9 or 17+ digit integer should work for whatever you need that, and 64bit type has 19 IIRC.

OK you've misunderstood floats a fair bit here; anyway, what you're describing is basically no different to just using the float approximation of sqrt(3).
The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell.

#### Sandwich

• Got Screen?
• 212
##### Re: Math/geometry Question
Given that sqrt(3) is an irrational number...

It makes perfect sense though....

Ok, thanks guys. Just checking. I found a few options that are "close enough" (one integer in the 100-200 range resulted in a number that had .0023###-something tacked on to it, which is near enough for web accuracy IMO).
SERIOUSLY...! | {The Sandvich Bar} - Rhino-FS2 Tutorial | CapShip Turret Upgrade | The Complete FS2 Ship List | System Background Package

"...The quintessential quality of our age is that of dreams coming true. Just think of it. For centuries we have dreamt of flying; recently we made that come true: we have always hankered for speed; now we have speeds greater than we can stand: we wanted to speak to far parts of the Earth; we can: we wanted to explore the sea bottom; we have: and so  on, and so on: and, too, we wanted the power to smash our enemies utterly; we have it. If we had truly wanted peace, we should have had that as well. But true peace has never been one of the genuine dreams - we have got little further than preaching against war in order to appease our consciences. The truly wishful dreams, the many-minded dreams are now irresistible - they become facts." - 'The Outward Urge' by John Wyndham

"The very essence of tolerance rests on the fact that we have to be intolerant of intolerance. Stretching right back to Kant, through the Frankfurt School and up to today, liberalism means that we can do anything we like as long as we don't hurt others. This means that if we are tolerant of others' intolerance - especially when that intolerance is a call for genocide - then all we are doing is allowing that intolerance to flourish, and allowing the violence that will spring from that intolerance to continue unabated." - Bren Carlill