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

  • SEARCH
  • Home
  • 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 8359575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:11:11+00:00 2026-06-09T11:11:11+00:00

I am using raphael to animate a ball and need to find out the

  • 0

I am using raphael to animate a ball and need to find out the position after stopping the animation, here is the code I have:

ball.stop();
console.log(ball.attrs.transform);
// t399.6625490203161,180r180

how do I convert this string into the x,y position of the ball?

  • 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-06-09T11:11:12+00:00Added an answer on June 9, 2026 at 11:11 am

    You can use Element.getBBox for this:

    var x = ball.getBBox().x;
    var y = ball.getBBox().y;
    var r = ball.getBBox().height / 2;
    console.log(x, y, r);
    

    But beware:

    The coordinates (element.getBBox().x, element.getBBox().y) will refer to the upper left corner of the bounding box.
    If the ball is a circle, that point will not even be contained in the circle and it might be more sensible to work with the coordinates of the center.

    Given the bounding box bbox, to those would be

    var x = bbox.x + bbox.width / 2,
        y = bbox.y + bbox.height / 2;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Raphael JS library and here is my code: var rectangle =
so here, I have a sequence of animations using Raphael: fade in curve fade
hello i have just start using Raphael but i'm very confused in the following
I have a png graphic that is put in the web page using raphael
I have a script that has a few timeouts, draws a menu using Raphael
I'm using the Raphael library to draw some shapes, and then animate them into
I'm trying to animate an eclipse moving along a path using Raphael v2.0.2. I
I am building a line graph application using Raphael.js and need to draw a
I am using Raphael-js to position text on a canvas. Is it possible to
I'm trying to create an image animation using Raphael JS. I want the effect

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.