omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. yodayoda230

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 32
    • Best 0
    • Controversial 0
    • Groups 0

    yodayoda230

    @yodayoda230

    0
    Reputation
    789
    Profile views
    32
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    yodayoda230 Unfollow Follow

    Latest posts made by yodayoda230

    • RE: Line segments intersection? (SOLVED)

      Cheers. Just been playing it :)

      posted in Pythonista
      yodayoda230
      yodayoda230
    • RE: Line segments intersection? (SOLVED)

      Can't wait for the game! :)

      posted in Pythonista
      yodayoda230
      yodayoda230
    • RE: Feature Requests

      Agree with eliskan on the double-quote issue.

      posted in Pythonista
      yodayoda230
      yodayoda230
    • RE: Three letter word before "is" crashes the app?

      I can't reproduce error. (Ipad3, 6.1.3 ios)

      posted in Pythonista
      yodayoda230
      yodayoda230
    • RE: Line segments intersection? (SOLVED)

      The (pseudo)code snippet there:
      def ccw(A,B,C):
      return (C.y-A.y) * (B.x-A.x) > (B.y-A.y) * (C.x-A.x)

      Return true if line segments AB and CD intersect

      def intersect(A,B,C,D):
      return ccw(A,C,D) != ccw(B,C,D) and ccw(A,B,C) != ccw(A,B,D)

      Looks pretty interesting(and pretty concise!) I will try that.

      posted in Pythonista
      yodayoda230
      yodayoda230
    • RE: Keyboards

      Thanks will look into it. I have a Marware carbon fibre case which is really good and was £20, so I am a bit loath to change it!
      (P.s. it's not REAL carbon fibre;)

      posted in Pythonista
      yodayoda230
      yodayoda230
    • RE: Line segments intersection? (SOLVED)

      Okay Coder123, that's slightly easier! :)

      posted in Pythonista
      yodayoda230
      yodayoda230
    • RE: Line segments intersection? (SOLVED)

      This sorta works...
      <pre>
      #line1...
      xd= line1[2]-line1[0]
      yd= line1[3]-line1[1]
      g1=yd/xd
      c1=line1[1]-(g1*line1[0])
      #formula is y= g1 * x + c1

      #line2...
      xd2= line2[2]-line2[0]
      yd2= line2[3]-line2[1]
      g2=yd2/xd2
      c2 = line2[1] - (g2 * line2[0])
      #formula is y= g2 * x + c2

      both formulas will be equal at the intersection,

      i.e. one minus the other equals zero

      (g1 * x) + c1 - (g2 * x) - c2 = 0

      #solve for x...
      xinter = (c2-c1) / (g1-g2)

      but is xinter somewhere in the correct range?

      eg the range of one of the lines x bounds

      note: needs work as needs to limit to overlapping x range

      if xinter in range(line1[0],line1[2]):
      return True
      else:
      return False
      </pre>

      posted in Pythonista
      yodayoda230
      yodayoda230
    • RE: Line segments intersection? (SOLVED)

      I just sketched this out using linear equations and it worked, and it seems like others on the web do the same - find the point where both linear equations equal each other ( or if they don't, then your lines don't intersect)
      Nice example here :
      http://keisan.casio.com/has10/SpecExec.cgi?id=system/2006/1223519249
      But wonder if something more elegant using the "in" function for rectangles might work...hmmm

      posted in Pythonista
      yodayoda230
      yodayoda230
    • RE: A* Pathfinding

      Thanks, this looks very interesting. You get an A* for working this out! :)

      posted in Pythonista
      yodayoda230
      yodayoda230