User Tag List

Results 1 to 3 of 3

Thread: real or integer values

  1. #1
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Mar 2009
    Location
    Bethesda, MD
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    real or integer values

    In an expression which I use to calculate the angle of a rotating cannon, I use an arc tangent function of the difference in Y coordinates over the difference in X coordinates. The expression is:

    ATan(((Y( "active" )-Y( "Active 13" ))/((X( "active" )-X( "Active 13" )))))

    Unfortunately, it is not working.

    When I deconstruct this equation to troubleshoot, I found that the term for the difference in Y was calculating fine, and the difference of X was calculating fine. However, the division of these terms yields an integer instead of a real number, and this integer is what is provided as the argument for the arctan.

    Long story short, why would the division of delta Y over delta X yield an integer and not a real number.

    Thanks for your help.

  2. #2
    Clicker Multimedia Fusion 2
    SEELE's Avatar
    Join Date
    Jul 2007
    Location
    Terra australis incognito
    Posts
    1,916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: real or integer values

    site noteI think you have a few to many brackets)

    Yeah, mmf likes to do that when dealing with positions, i guess it assumes that the return will probably be fed back into a position(which is usually a int)

    To force it to handle them as 'reals' simple change 0.0 in each entity before devision.
    like so:

    ATan((( Y( "active" )-Y( "Active 13" )-0.0)/(X( "active" )-X( "Active 13" )-0.0)))

    .. used subtract here to avoid more brackets.

  3. #3
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Mar 2009
    Location
    Bethesda, MD
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: real or integer values

    It works fine, thanks!

Similar Threads

  1. why always integer value when you set global val.?
    By EasySite in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 7th July 2010, 03:26 PM
  2. Integer to String in C++
    By Dines in forum Extension Development
    Replies: 6
    Last Post: 20th May 2010, 08:40 AM
  3. Integer split
    By James in forum Released Extensions
    Replies: 1
    Last Post: 1st August 2007, 03:45 PM
  4. Non-integer scaling
    By BenMo in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 3rd January 2007, 10:54 PM
  5. Text To Integer
    By aussiedave in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 8th September 2006, 07:21 AM

Posting Permissions

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