A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: [RESOLVED] How do you get a unique ID from two numbers w/o ordering them?

Hybrid View

  1. #1
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    923
    aah, integers - I kinda thought of any real numbers. it might work with integers, indeed, maybe run 100000x100000 check loop? if you have a couple of hours to waste
    who is this? a word of friendly advice: FFS stop using AS2

  2. #2
    Senior Member joshstrike's Avatar
    Join Date
    Jan 2001
    Location
    Alhama de Granada, España
    Posts
    1,136
    It works, at least to 1000 x 1000...and I don't see why it wouldn't work infinitely =)

    It also works to produce unique identifiers for reversible combinations of more than two integers, like this:

    [unique floating id from a set of three integers]
    (a^2+b^2+c^2)+( sin(atan(a/b))*cos(atan(a/b))*sin(atan(a/c))*cos(atan(a/c))*sin(atan(b/c))*cos(atan(b/c)) )

    Solved!

  3. #3
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    923
    btw,


    which means, SIN(ATAN(x/y)) * COS(ATAN(x/y)) = TAN (ATAN (x/y)) / (1 + TAN^2 (ATAN(x/y))) = (x/y) / (1 + (x/y)^2) = (x * y) / (x^2 + y^2), right?
    Last edited by realMakc; 11-27-2009 at 03:51 PM.
    who is this? a word of friendly advice: FFS stop using AS2

  4. #4
    Senior Member joshstrike's Avatar
    Join Date
    Jan 2001
    Location
    Alhama de Granada, España
    Posts
    1,136
    Thanks! That's nifty...
    feeling pretty good about solving this one =)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center