# Math Is Fun Forum

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

You are not logged in.

## #1 2005-09-12 13:14:23

sonyafterdark
Member
Registered: 2005-09-12
Posts: 28

### The cool maths that games can teach you!

I'm going to present you with 2 simple geometry problems. I've already bumped into them and have found solutions on my own, though doubtless there is (was) someone out there who's solved these before me.

Here goes.

1. How can you tell if a geometrical body is closed or open (is there any way to get inside it without going through a face)? Only a real test will do. No intuitive answers such as "You see if there's a facet missing or not" is acceptable. A valid algorhitm is required.

Nothing is obvious in the computer world, remember this. Water might be dry for all a computer knows...

2. Given N planar line segments (line segments inside a plane) that may intersect THEMSELVES in ANY WAY, what is the MAXIMUM NUMBER of segments that may be projected upon some arbitrary line (inside the same plane)? All of the N segments stay on the same side of the line that projection occurs on.

The challenge has been set. Who shall rise to meet it? If there's no correct answer to any one of the 2 questions within a reasonable period of time I shall intervene to enlighten.

Do contact if clarifications are needed.

Cheers!

An intelligent man usually knows how to reach his goals. A wise man also knows what goals to reach...

Offline

## #2 2005-09-13 09:25:28

MathsIsFun
Registered: 2005-01-21
Posts: 7,713

### Re: The cool maths that games can teach you!

First, thank you for the cool puzzles.

Second, what wierd timing ... I have been working on modelling solids the last week!

"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

## #3 2005-09-13 17:54:02

ryos
Member
Registered: 2005-08-04
Posts: 394

### Re: The cool maths that games can teach you!

I also don't know what #2 is asking.

These answers aren't rigorous proofs by any means, just intuitive thoughts based on the definitions of things.

El que pega primero pega dos veces.

Offline

## #4 2005-09-16 23:53:27

sonyafterdark
Member
Registered: 2005-09-12
Posts: 28

### Re: The cool maths that games can teach you!

Sorry, I didn't mention we were talking about a volumetric body. But no. The answer is quite simple actually.

1. If there is at least one edge that is not common to at least 2 faces (facets) of the body, then it is open. Otherwise it is closed. (Note: if there's one edge of this type there's bound to be at least another 2 )

2. The MAXIMUM NUMBER of segments that may be projected upon some arbitrary line is (S-1)*4, where S is the number of segments that may intersect themselves in any way possible and are projected into the segments on the arbitrary line.

Thanx for posting. Hope this is clear enough.

Oh, and Wink, how about a joint 3D engine project. You good at coding?

Last edited by sonyafterdark (2005-09-17 00:01:24)

An intelligent man usually knows how to reach his goals. A wise man also knows what goals to reach...

Offline

## #5 2005-09-17 12:30:02

Zach
Member
Registered: 2005-03-23
Posts: 2,075

### Re: The cool maths that games can teach you!

Sony, that's MathsIsFun, not winked. That's just his user award thing-a-mob.

Boy let me tell you what:
I bet you didn't know it, but I'm a fiddle player too.
And if you'd care to take a dare, I'll make a bet with you.

Offline

## #6 2005-09-17 14:09:57

ryos
Member
Registered: 2005-08-04
Posts: 394

### Re: The cool maths that games can teach you!

Hey sony, what happens if you have a sphere? There's technically no facets...

El que pega primero pega dos veces.

Offline

## #7 2005-09-17 15:32:55

sonyafterdark
Member
Registered: 2005-09-12
Posts: 28

### Re: The cool maths that games can teach you!

Come on Ryos, you just scramled for something to shut me up with .

Remember, we're talking about a computer implementation algo.

How would you even define (store) an open sphere except by triangulating it or using an infinite amount of data if the aperture (opening) is irregular? Tough one, isn't it?

And even if you could, somehow - other than triangulating -, store your open sphere, wouldn't it make the entire exercise futile seeing as how a normal (closed) sphere is defined so much simpler: a vertex (centre position) and a radius?

But the short, simple answer is, as you might expect, "I don't know".
But I've never thougt of it from this angle... what a difference it makes to be outside the box, no?

2nd. point:

Adminy, will you take me up on my offer to coproduce a 3D engine? you good at coding?

Oh, and here's a 3D treat ;D :

Applying fish eye lens projection effect :

VertexX
ProjectedX=--------------------------------------
√(VertexX²+VertexY²+VertexZ²)

and, analogue,

VertexY
ProjectedY=--------------------------------------
√(VertexX²+VertexY²+VertexZ²)

Next time I'll paste an description of curved interpolation. Stay tuned!!!

Enjoy. I'll be launching a HomeSite (eventually - I'm such a sloth ). I'll be sure to paste a link here!

Cheers!

Last edited by sonyafterdark (2005-09-17 15:35:39)

An intelligent man usually knows how to reach his goals. A wise man also knows what goals to reach...

Offline