1. Technical Field
Embodiments of the present disclosure relate to simulation technology, and particularly to a handheld device and a method for simulating flight path of a boomerang on a display screen of a handheld device.
2. Description of Related Art
Acceleration sensors and electronic gyroscopes are usually embedded in handheld devices (e.g., cell phones, computer tablets) to detect movements of the handheld devices, so that many electronic games can be played on a display screen of the handheld device according to the movements of the handheld device. However, there is no electronic game of boomerang taking advantage of the acceleration sensor and electronic gyroscope of the handheld device. Therefore, a method for simulating flight path of boomerang on the display screen of the handheld device is desired.
All of the processes described below may be embodied in, and fully automated via, functional code modules executed by one or more general purpose electronic devices or processors. The code modules may be stored in any type of non-transitory computer-readable medium or other storage device. Some or all of the methods may alternatively be embodied in specialized hardware. Depending on the embodiment, the non-transitory computer-readable medium may be a hard disk drive, a compact disc, a digital video disc, a tape drive or other suitable storage medium.
In one embodiment, the acceleration sensor 20 is used to detect an acceleration of the handheld device 2 at each preset time interval (e.g., one second). The electronic gyroscope 21 is used to detect a rotation angle of the handheld device 2 at each preset time interval. For example, the acceleration sensor 20 may be a two-axis accelerator, a three-axis accelerator, the electronic gyroscope 21 may be a two-axis gyro or a three-axis gyro.
The boomerang game simulating system 24 is used to detect movement parameters (e.g., the accelerations and the rotation angles) of the handheld device 2 using the acceleration sensor 20 and the electronic gyroscope 21, and display a simulated flight path of an image of the boomerang on the display screen 22 according to the detected movement parameters of the handheld device 2. In one embodiment, the boomerang game simulating system 24 may include computerized instructions in the form of one or more programs that are executed by the processor 25 and stored in the storage device 23 (or memory). A detailed description of the boomerang game simulating system 24 will be given in the following paragraphs.
Before introducing the method shown in
According to the Bernoulli's principle, a wing generates more lift force when it is moving faster so point A generates more lift force than point B. “FA” in
F=mV2/R (1)
C=JωΩ (2)
In the two equations, “m” represents a mass of the boomerang, “R” represents a radius of a flight path of the boomerang, “J” represents an angular momentum of the boomerang, and “Ω” represents a rate of precession in radians/sec. The flight path of the boomerang may be determined using the two equations. An throwing angle “θ” of the boomerang is determined according to movement data of the handheld device 2, and an optimized throwing angle is between ten degrees and thirty degrees.
In step S10, the state data obtaining module 240 detects a state of the handheld device 2 using the acceleration sensor 20 and the electronic gyroscope 21 when the user starts a boomerang simulation game in the handheld device 2. When the boomerang simulation game is played, the user may rotate the handheld device 2 around an X-axis, a Y-axis, and an Z-axis of a coordinate system constructed based on the handheld device 2. Then, the electronic gyroscope 21 detects a rotation angle “θx” around the X-axis of the handheld device 2 (hereinafter referred to as “X-axis rotation angle”), a rotation angle “θy” around the Y-axis of the handheld device 2 (hereinafter referred to as “Y-axis rotation angle”), and a rotation angle “θZ” around the Z-axis of the handheld device 2 (hereinafter referred to as “Z-axis rotation angle”). In one embodiment, the Z-axis rotation angle “θZ” is equal to the throwing angle “θ” of an image of the boomerang on the display screen 22 (as shown in
In step S11, the state data obtaining module 240 obtains accelerations and rotation angles of the handheld device 2, which are detected by the acceleration sensor 20 and the electronic gyroscope 21 at each preset time interval (e.g., one second). In one embodiment, the accelerations of the handheld device 2 may include an acceleration of the handheld device 2 towards an X-axis direction (hereinafter referred to as “X-axis acceleration”), an acceleration of the handheld device 2 towards a Y-axis direction (hereinafter referred to as “Y-axis acceleration”), and an acceleration of the handheld device 2 towards an Z-axis direction (hereinafter referred to as “Z-axis acceleration”). The rotation angles of the handheld device 2 may include an X-axis rotation angle “θx” of the handheld device, a Y-axis rotation angle “θy” of the handheld device, and an Z-axis rotation angle “θz” of the handheld device.
In step S12, the flight path determining module 241 determines a flight path of the image of the boomerang (hereinafter referred to as “boomerang image”) according to the accelerations and the rotation angles of the handheld device 2. In one embodiment, the flight path of the boomerang image is simulated using the above-mentioned equations (1) and (2). When the boomerang simulation game is played, the user rotates the handheld device 2. The acceleration sensor 20 and the electronic gyroscope 21 detects the accelerations and the rotation angles of the handheld device 2 to determine the flight path of the boomerang image on the display screen 22.
In one embodiment, the flight path determining module 241 determines a direction of the linear velocity V of the boomerang image on an X-Y plane of the display screen 22 according to the X-axis rotation angle “θx” and the Y-axis rotation angle “θy” of the handheld device 2, and determines a value of the linear velocity V of the boomerang image according to the Z-axis acceleration of the handheld device 2. For example, the value of the linear velocity V of the boomerang image is equal to the Z-axis acceleration of the handheld device 2. The angular velocity ω of the boomerang image is determined according to the X-axis rotation angle “θx” of the handheld device 2. For example, the angular velocity ω of the boomerang image is equal to the X-axis rotation angle “θx” of the handheld device 2 per in second.
After determining the direction and the value of linear velocity V of the boomerang image, the angular velocity ω of the boomerang image, and the throwing angle “θ” of the boomerang image, the flight path of the boomerang image on the display screen 22 are determined according to the simulation equations (1) and (2). In the simulation equations (1) and (2), the radius “R” of the flight path of the boomerang image and the rate of precession “Ω” may be predetermined values. For example, R=4 cm (centimeters), and Ω=1 radians/sec.
In step S13, the flight path displaying module 242 displays the flight path of the boomerang image on the display screen 22 of the handheld device 2, so that the boomerang simulation game is simulated on the display screen 22 of the handheld device 2 (as shown in
It should be emphasized that the above-described embodiments of the present disclosure, particularly, any embodiments, are merely possible examples of implementations, merely set forth for a clear understanding of the principles of the disclosure. Many variations and modifications may be made to the above-described embodiment(s) of the disclosure without departing substantially from the spirit and principles of the disclosure. All such modifications and variations are intended to be included herein within the scope of this disclosure and the present disclosure and protected by the following claims.
Number | Date | Country | Kind |
---|---|---|---|
101143775 | Nov 2012 | TW | national |