Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6101797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:32:26+00:00 2026-05-23T13:32:26+00:00

I have a SVG path, created in Inkscape, that is a single Move (M

  • 0

I have a SVG path, created in Inkscape, that is a single Move (“M … z”) command. The uppercase ‘M’, as per the SVG spec, indicates an absolute path, however for my application I require relative paths.

What is the algorithm to convert an absolute path to a relative path? Do I start with the last x and y coordinates and respectively subtract the previous value until I get to the start of the values? Bonus marks for:

  • Converting the path to relative for me (meh)
  • Providing a link to a resource of some sort that will convert between absolute and relative SVG paths OR pointing out how to do this with Inkscape (I’ve searched the mailing list and found other users talking about having to recompile from source to add the option manually :|)
  • Giving a jquery one-liner that will convert aboslute to relative and vice-versa

The path in question is an explosion-ey sort of starburst:

M 9.6428572,4.8214285 17.857142,19.285714 0.89285714,22.142857 17.678572,29.285714 1.9642857,41.071429 23.75,37.678572 26.071429,49.285714 37.321428,38.75 47.5,48.392857 51.607143,37.5 61.964286,48.214286 62.321429,34.285714 78.392857,37.857143 64.107143,24.464286 81.071428,21.607143 63.928571,17.857143 70.535714,3.5714284 54.821429,12.142857 50,1.2499999 40.535714,10.714286 31.607143,0.89285704 28.035714,13.928571 z

I’ve searched SO for similar questions, but only found questions about OS paths or relative to absolute SVG paths (and none of them were specifically asking about the algorithm to do so). If this is a duplicate feel free to close it.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:32:27+00:00Added an answer on May 23, 2026 at 1:32 pm

    EDIT: I now have an online program to do this more generally:
    http://petercollingridge.appspot.com/svg_transforms

    The path you want is:

    d="m9.6428572,4.8214285 8.214285,14.464285 -16.964285,2.857143 16.785715,7.142857 -15.714286,11.785715 21.785714,-3.392857 2.321429,11.607142 11.249999,-10.535714 10.178572,9.642857 4.107143,-10.892857 10.357143,10.714286 0.357143,-13.928572 16.071428,3.571429 -14.285714,-13.392857 16.964285,-2.857143 -17.142857,-3.750000 6.607143,-14.285715 -15.714285,8.571429 -4.821429,-10.892857 -9.464286,9.464286 -8.928571,-9.821429 -3.571429,13.035714z"/>
    

    I guess you start from the last coordinate pair and work backwards, put it’s just as easy to start at the second coordinate pair and minus the previous one (and a bit more efficient as you don’t have to repeatedly look up the same value).

    I did this in Python, but I’m sure it could be done with Javascript relatively easily.

    d = "9.6428572,4.8214285 17.857142,19.285714 0.89285714,22.142857 17.678572,29.285714 1.9642857,41.071429 23.75,37.678572 26.071429,49.285714 37.321428,38.75 47.5,48.392857 51.607143,37.5 61.964286,48.214286 62.321429,34.285714 78.392857,37.857143 64.107143,24.464286 81.071428,21.607143 63.928571,17.857143 70.535714,3.5714284 54.821429,12.142857 50,1.2499999 40.535714,10.714286 31.607143,0.89285704 28.035714,13.928571"
    c = [map(float,l.split(',')) for l in d.split()]
    c2 = ["%.6f,%.6f" % (c[n][0] - c[n-1][0], c[n][1] - c[n-1][1]) for n in range(1, len(c))]
    print "%.6f,%.6f " % (c[0][0], c[0][1]) + ' '.join(c2)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an SVG file that contains several elements (like path, circles, rectangles, etc.).
I have a path I've created in Illustrator and saved as an SVG. Now
I have a SVG file that I want to extend by adding onclick handlers
I have the following SVG source code that generates a number of boxes with
I have created a WFP UserControl with some complex XAML (converted from SVG). It's
I have a function that loads a SVG Dom from a file. Currently, it
I have used http://readysetraphael.com/ to convert a svg to a path in raphaeljs. I
We have code that loads SVG via Ajax and interacts via Javscript. The SVG
In my application I have rolled my own SVG converter that translates a raw
Scenario: I have SVG image that I can zoom-in and zoom-out. Depending on the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.