User Tag List

Results 1 to 6 of 6

Thread: Graphing a Line Problem (Math)

  1. #1
    Clicker Fusion 2.5

    Join Date
    Sep 2006
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Graphing a Line Problem (Math)

    I'm trying to create an invisible line formed by the direction an object is facing and its current hotspot, and when the Y value of another object is greater than a spot on that line (determined by that object's X position), then "do something." In this case, I just made it paste to the background repeatedly so I can see where the math actually draws the line. I'm not sure how to make this work, and what I do have works even worse at different angles. Any help would be appreciated.

    An example .mfa is attached for what I've gotten so far.
    Attached files Attached files

  2. #2
    Clicker Fusion 2.5

    Join Date
    Sep 2006
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ...

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Something like this?
    Attached files Attached files

  4. #4
    Clicker Fusion 2.5

    Join Date
    Sep 2006
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Pretty close, ya. I think I might be able to use that, but just speculating. The only problem I have with that is that it looks like it requires a detector object, and testing the Y position of the object that changes colors has to be aligned with that detector and changes colors based on the hotspot instead of possibly being above or below a line drawn by a direct path to the rotating object and the detector object.

    What I'm trying to make can't move so freely.

    --- After testing that out further, it still doesn't work.

  5. #5
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,295
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    We know the formula for a straight line is: Y = MX + C

    To find M (the gradient), we use trigonometry:
    M = (0-Sin(Angle( "Line" )))/Cos(Angle( "Line" ))

    To find C (the intercept), we rearrange the original formula, and substitute the X and Y coordinates of a point we know is somewhere along the line (we can use the line object's hotspot).

    C = Y( "Line" )-(M*X( "Line" ))

    Now that we know both M and C, we can solve for Y:

    If Y position of Object < (M*X( "Object" ))+C
    ...then the object is above the line.

    eg.
    http://skydrive.live.com/redir?resid...094271BBDA!544

  6. #6
    Clicker Fusion 2.5

    Join Date
    Sep 2006
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Exactly what I needed! Thank you, kind sir. You are a gentleman and a scholar!

Similar Threads

  1. Calculating Angles (math problem I suspect)
    By cgmonkey in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 22nd September 2009, 09:16 AM
  2. Graphing Object
    By drnebula in forum Extension Development
    Replies: 4
    Last Post: 20th August 2009, 05:31 PM
  3. Math Challenge - no actual problem
    By Verd0uX in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 25th June 2009, 04:36 PM
  4. Cos and Sin math problem (custom 8 direction)
    By Shawn in forum Multimedia Fusion 2 - Technical Support
    Replies: 19
    Last Post: 2nd April 2009, 12:55 PM
  5. Quick math problem? Me being stupid i think!
    By Gibbon in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 20th June 2008, 12:55 PM

Tags for this Thread

Posting Permissions

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