Loading ...
Sorry, an error occurred while loading the content.

Opposite of getPointAtLength: getLengthAtPoint?

Expand Messages
  • Arjen
    In svg we have path.getTotalLength() path.getPointAtLength(fraction) to get a point.x and point.y at the fraction position. But what if we have point.x and
    Message 1 of 1 , Feb 27, 2011
    • 0 Attachment
      In svg we have
      path.getTotalLength()
      path.getPointAtLength(fraction)
      to get a point.x and point.y at the fraction position.

      But what if we have point.x and point.y on a path (click with event) and would like to calculate the fraction?
      So, is there an opposite of getPointAtlength: getLengthAtPoint?

      The goal is to calculate the entries in keyPoints interactively.
    Your message has been successfully submitted and would be delivered to recipients shortly.