C
Chris G
Guest
What I'd like to do is create a class which allows you to create a shape... something like:
$square = $create->shape(4, 5, 5, 5, 5);
* This example would create a square (4 sides) with all sides equal to a length of 5 and stores it in a variable with the name of 'square' for later use.
Then another class to solve various mathematical equations for the shape...like finding the area...
echo $solve->area($square);
* This finds the area of the square created.
Can someone PLEASE help me get started in the right direction on this?
FYI - I know how to construct and instantiate a class...so a tutorial of this isn't what I'm looking for.
I'm looking for some guidance on creating a class which creates a shape and finds its area...
Thank you, though. =)
$square = $create->shape(4, 5, 5, 5, 5);
* This example would create a square (4 sides) with all sides equal to a length of 5 and stores it in a variable with the name of 'square' for later use.
Then another class to solve various mathematical equations for the shape...like finding the area...
echo $solve->area($square);
* This finds the area of the square created.
Can someone PLEASE help me get started in the right direction on this?
FYI - I know how to construct and instantiate a class...so a tutorial of this isn't what I'm looking for.
I'm looking for some guidance on creating a class which creates a shape and finds its area...
Thank you, though. =)