Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3509 Members - Latest Member: lioneltenel

27. May 2012, 12:39:27 am
Xith3D CommunityXith3D InternalsDeveloper discussion (Moderators: Marvin Fröhlich, 'n ddrylliog)Dev right for Open mail please
Pages: [1]
Print
Author Topic: Dev right for Open mail please  (Read 2253 times)
t_larkworthy
Just dropped in

Offline Offline

Posts: 15


View Profile Email
« on: 07. September 2007, 02:10:17 pm »

Hello. The bureaucracy at university is nearing an end at last and I am about to start some coding again. Its more application programming than improvements to JOODE mind. Anyway I am creating some math stuff so I would like to commit it to OpenMail if you will have it.

Aim 1: to introduce rational datatypes i.e. fractions , so that matrix algebra involving 90 degree rotations, and integer scalings etc. will not have deal with the imprecision of floating datatypes (and also be fast)

Aim 2: introduce BASIC radical datatypes i.e. 2 + root(3) so that matrix algebra involving rotations of 45 degrees, 30 degrees, 60 degrees etc. can be done algebraicaly and exactly.

Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #1 on: 07. September 2007, 03:11:19 pm »

Hi, Tom.

Good to know, that you're back Smiley.

I've added you to the lost of devs.

Marvin
Logged
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #2 on: 07. September 2007, 04:52:53 pm »

I *love* it when people misspell words Cheesy It is sometimes so funny.

Example :
Quote
OpenMail
I didn't know, that I launched an open-source e-mail client application project ? Cheesy

Example #2 :
Quote
I've added you to the lost of devs
Maybe there has been a new release of the "English language", while I was off ? ^^

But, btw, welcome back, Tom !
Logged
t_larkworthy
Just dropped in

Offline Offline

Posts: 15


View Profile Email
« Reply #3 on: 09. September 2007, 04:19:46 pm »

When I googled OpenMali for the SVN address I mispelled it in exactly the same way. For some reason my typing fingers really struggle with that name (I even just mispelled it again whilst writing this, haha).

 
Logged
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #4 on: 10. September 2007, 04:31:03 pm »

Well, it's all unsurprising.

"mail" is a word your (and everyone's) fingers are used to type, so when your brain order a "mali", your fingers think it's an error and correct by themselves Cheesy
Logged
t_larkworthy
Just dropped in

Offline Offline

Posts: 15


View Profile Email
« Reply #5 on: 08. January 2009, 04:40:32 pm »

Right. Well, it took along time but I think I am actually ready to commit something.

So for my PhD project I have found floating point rounding errors a massive problem. As my geometry of jointed robots is constrained to 0,30,45,60 and 90 degrees, you should be able to do the spatial transformation symbolically without any loss of error.

So I started the Radical1 number representation. I then found it extremely time consuming to code, and extremely difficult programming in the matrix inverse functions. The formula is known, but actually writing it with custom number objects without operator overloading is difficult.

Anyway, so I abandoned that project for a while.

However, I am in my final year PhD now and I am getting the full robot simulator running and I find I *must* have no rounding errors. So I have ressurrected the project and have actually managed to get all the stuff working now.

so what I have now is an incomplete mirror of MatrixNxMf and Matrix4f, TupleNf suffixed by rad. The Matrix4rad invert and determinant function work!

you can add subtract and multiply radical numbers of the form:

sum of ((rational number)*(sqrt(rational number)))

You cannot divide. You can sometimes modulus by a rational number. Sqrts can only be bounded by rational numbers. And you can only decide whether one rational number is bigger than another symbolically. So for some cases a modulus won't work, because it can't decide whether is larger or within the modulus's operands bounds.

The total functionality is definitely not complete, but I think people who would use this functionality are probably smart enough to add functionality when needed. Things that need adding include

Automatically improve the Rational bounds of a radical expression automatically using bisection.

A compareTo method between radical expressions (the bounds bit is present, but not integrated throughout the system yet)

Matrix3rad, Vector3rad, and all the other special cases apart from Matrix4rad

Do you want this in openmali? Even incomplete its pretty brilliant at what it does. As inversion of 4x4 matrices are possible you can build working geometry trees with it. (you can't invert scaling matrices though, because their determinant is !=1 and you can't divide radical expressions by radical expression (in the form I have chosen).

Oh yeah. I have built TestCases for some of the functionality but I dunno where test cases go in the openmali project structure. Do you use JUnit?

Tom




Logged
t_larkworthy
Just dropped in

Offline Offline

Posts: 15


View Profile Email
« Reply #6 on: 08. January 2009, 04:42:11 pm »

Jesus! I just realized I posted that thread in Sept. 2007. Where does all the time go!! (he says pulling out his hair)
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #7 on: 08. January 2009, 09:33:04 pm »

Hey Tom. Good to hear from you again.

Even if I really have no idea, what radical numbers are, I would like to have your code in OpenMaLi.

The testcases can be put anywhere under org.openmali.test. We don't use JUnit. But if you think, you really can't live without it, just commit it as JUnit tests.

Marvin
Logged
t_larkworthy
Just dropped in

Offline Offline

Posts: 15


View Profile Email
« Reply #8 on: 08. January 2009, 11:42:04 pm »

JUnit: "if you really can't live without it"

Haha. Good point, I tend to use it to evaluate booleans generally. I think I can live without. I only use it because intelliJ automatically adds the jar to your module when you write "extends TestCase"

You'll know radicals. A radical is a square root sign. sqrt(3). The 3 is the radicand. The sqrt sign is the radical.

Some bits of geometry lend themselves to being expressed in a form containing sqrt signs, e.g. sin(pi/2) = sqrt(2)/2 or something similar (comes from pythagorus). The functionality I have made allows you to explicitly represent those kind of numbers, so you can do 3D geometry with certain angles (quite alot acually: http://en.wikipedia.org/wiki/Exact_trigonometric_constants) WITHOUT loss of precision. i.e. translate 3 units,rotate 30 degrees in X axis etc. The point you reach will be expressed as something like
1/4 * sqrt(3) + 3*sqrt(2) ... (as components of 4x4 matrices)

Ahhh, transformations without drift! without error! Its important for my app. because I need to *search* different geometric configurations. I need to detect if I have seen the same geometry twice, so I need a fast hash code. If there is drift in the system, it might think the same geometry is different just because it was calculated in a different order. You can't really hash with floats so this solves a major issue.

Anyway. its cool. The embedded people might actually like it as well because its all done in integer arithmetic.







Logged
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #9 on: 19. March 2009, 04:38:23 pm »

GOSH did I just hear "embedded" and "Java" in the same phrase ?
* Amos Wenger shivers.
(yeah and don't tell me about J2ME).

But yeah, if not already committed, this code is exactly the type of code OpenMali has been created for. So go on (you do have Developer rights on the project anyway, don't you ?).
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic