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 8697017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:24:48+00:00 2026-06-13T01:24:48+00:00

Here is a static frame from an atom animation I’m working on in JavaScript,

  • 0

Here is a static frame from an atom animation I’m working on in JavaScript, modelled off this image.

enter image description here

Here is the code used to determine the position of an electron in its orbit based on time:

// Get position along elliptical path.
var x = Math.cos( this.timer.delta() * this.speed ) * ( this.pathWidth / 2 );
var y = Math.sin( this.timer.delta() * this.speed ) * ( this.pathHeight / 2 );

What I’d like to do is place the electron above the nucleus when on the orange part of the path, and below the nucleus during the green segment.

When this.timer.delta() == 0, the electron is at the extreme-right end, and then proceeds to travel counter-clockwise.

I’m looking for help with the following two things:

1) Finding the point in time in which the electron will be at the far left of its orbit.

2) Determining which half of the path an electron is currently on for any given time.

Ideally, the solutions should work regardless of the value of this.speed (which is number multiplier for speeding up or slowing down the animation).

  • 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-13T01:24:49+00:00Added an answer on June 13, 2026 at 1:24 am

    It all depends on the angle – and the angle is this part in your expression:

    this.timer.delta() * this.speed
    

    So you can simply determine whether the angle is between zero and PI – and if it is – the nucleus is “in front”.

    Of course simply checking whether y is non-negative does the same trick.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

here is the code public static final String DATE_TIME_FORMAT = yyyy-MM-dd kk:mm:ss; public static
Here is my code : public static void main(String[] args) { // System.setProperty( //
here is the code (java): class prime { public static boolean prime (int a,
Here's the code: class qual { public static int fibonacci(int n) { if (n
Here is the code: class Time { public static void printTime (int hour, int
Here's the code snippet: public static void main (String[]arg) { char ca = 'a'
This is pretty particular, so I'm hoping someone on here has used VLCJ on
so im making a simple box from java and this is the code so
Ok, i wrote this pice of code as an beginner in java learning from
I am using Jon Skeet's ReadFully method implemented here: public static byte[] ReadFully(Stream stream)

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.