Re: The Start Of A Physics Engine For Euphoria
- Posted by achury May 24, 2009
- 1174 views
You have a made a very complex definition for point. And we are not sure will be final. Some other funcions are specific for so definition, if change in the future all will become useless. Many of those functions fit better as geometrics.e, more than physics.
I propose a more Euphoria-like aproach, for example:
Calculate distance between 2 points with
function distance(sequence a, sequence b)
a and b may be {x}, {x,y}, {x,y,z}, {x,y,z,t} (4D space-time) but allways the sequences must to have the same length
If you define a point with a complex structure you can pass to the function with something like:
print(1, distance(PointA[1..3], PointB[1..3]))
The distance of the X proyections:
print(1, distance(PointA[1], PointB[1]))
The distance for Y proyections:
print(1, distance(PointA[2], PointB[2]))