Back on the math ( slightly different focus)

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

Big text book with lots of squiggly symbols and numbers...;)

Just kidding - I do need a reference though. My memory though vast is not infallible. Also most math texts will generally have fair organisation of math branches. Maybe I just like my reference texts too much...
User avatar
sweatje
Forum Contributor
Posts: 277
Joined: Wed Jun 29, 2005 10:04 pm
Location: Iowa, USA

Post by sweatje »

One thing I have not seen replicated in PHP is a three dimensional graphing library. JpGraph works well for 2D charts, but I have not stumbled across anything which does surfaces, etc.
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

So I'm NOT the only one looking for that..:)
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

I have a math book. I actually own three right now, a calculus book, a linear algebra book, and an advanceds math techniques book (which I don't think is possible to explain to a computer. ) . BTW, our project is also going to branch into 3D graphs after we get the math library done. :-D It'll just take some time is all.
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

the source forge project got approved in under 12 hours :-D Either way here is the unix name php-mat-lib. :-D
Just had to share the good news.
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

Making a few links... I generally get involved in projects if they are interesting and possibly applicable to my game development. This lib seems to, there's also another project LIFE (see the General Discussion "Let's build a rainforest" topic). There may be a little overlap in that LIFE may require certain math functions at a future point. I assume any LIFE project will be looking at distance and possibly other more complex operations as it proceeds.

Might be interesting to track that project, and see if there's any overlapping both projects could unite on...

It's a possibility.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

take a piece of string, tie to one point, go to other point, make knot where second point meets string. Measure string.

Voila - and without even touching a computer. Don't like technology anyway, they used to make things out of wood, I have you know.
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

there's something ironic about a man with near 3k posts on a message board saying he doesn't like technology:)
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

take a piece of string, tie to one point, go to other point, make knot where second point meets string. Measure string.
Or you could bust out the plain old paper and pencil and figure out the 3D distance using the square root of the sums of the squares of the differences between x y and z.
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

I hear tape measures are very useful...
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post by Grim... »

3D distance is a piece of <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span>. It's just 2 triangles, innit?
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

on topic you buggers.. :: kicks them all:: 3d distance is the same formula as 2d distance, just add your z's.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Now, what would really be cool is if you create a new datatype to represent polynomials.
User avatar
Skara
Forum Regular
Posts: 703
Joined: Sat Mar 12, 2005 7:13 pm
Location: US

Post by Skara »

that doesn't sound hard to me, until you get into the messing with y/f(x). Just use a string and replace the second... err.. something like this:
$p = new Polynomial("y=2*x",'y','x');
If you always used y and x, you wouldn't need the second two params. You could just split it at the = and do the math for x/y if you wanted to solve for something. If you wanted to perform functions on them it would be a bit harder, but doable. It all depends on what you want to do with the polynomials.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Probably this.

Code: Select all

class Polynomial {
    
    function getCoefficient($degree) {}
    function &multiply(&$polynomial) {}
    function &add(&$polynomial) {}
    function &subtract(&$polynomial) {}
    function evaluate($x) {}
    function getRoots() {} //we'll need Complex for this one...
    function &differentiate() {} //polynomial return
    function integrate($a, $b) {} //no indefinites...
    function getDegree() {}
    function getVertices($lowerbound = null, $upperbound = null) {}
    function graph() {} //heh heh...
    
}
Post Reply