Design a color light cycle controller - multisim

Design a color light controller: a total of 20 lights, arranged in a circle, the requirements of the lights according to the following rules:
(1) In the first minute, the lights run clockwise, and only 1 lights per second.
(2) in the second minute, the lights run counterclockwise, and every second only 1 lights out.
(3) In the third minute, the lights run in a clockwise direction, and every two seconds there are four lights.
(4) in the fourth minute, the lights run counterclockwise, and every 2 seconds there are 4 lights out.
Design a color light controller: a total of 20 lights, arranged in a circle, the requirements of the lights according to the following rules:
(1) In the first minute, the lights run clockwise, and only 1 lights per second.
(2) in the second minute, the lights run counterclockwise, and every second only 1 lights out.
(3) In the third minute, the lights run in a clockwise direction, and every two seconds there are four lights.
(4) in the fourth minute, the lights run counterclockwise, and every 2 seconds there are 4 lights out.

Related

libGDX particle effect: is it possible to reverse it?

I'm working with libGDX particle effect system, and I have a following need: to reverse an effect in time. These effects look like scattering particles, appearing in a single spot, and what I need is exactly the opposite - particles appearing in random places around the central spot and gathering in the central spot. It all is the sprite animation, and it could be reversed, but how?
I think you can because the particle editor allows negative velocity plus I've done it in the particle editor.
1 set the velocity to -300 low to +300 high (or whichever)
2 particle size is zero to begin with (invisible), this allows the particle to move away from origin at appear at a radius
3 at the desired radiues, when you arrive, restore the size (become visible).
4 this point is when the velocity reverses heading back to the origin.
The point is that negative or positive velocity both head away from the origin, but as you interpolate between the two you reverse the course. As long as you are invisible (make the particle 0 size) then you appear at the radius and travel inwards.

Subdividing a curve with points equal to distance between points

In three.js I have pushed some Vector3() coordinates into a variable, and I perform THREE.CatmullRomCurve3(points).getPoints(points*32); to get a curve. If I extrude a shape along it, it all looks fine.
The problem I am having now is that I want the camera to run along this curve, but the speed changes depending on how far it is from one (original) point to another. According to one of the examples from threejs.org, I loop through each of the new points and set the camera's position to those points. But if two points are 1 meters apart, or 2 meters apart, it is still 32 subpoints between each, and the camera will reach the end in the exact same time.
How can I do so that a 1 meter stretch gets 32 subpoints, and a 2 meter stretch gets 64 subpoints, and so the camera will take twice as long to complete the 2 meter stretch compared to the 1 meter stretch?
The problem I am having now is that I want the camera to run along this curve, but the speed changes depending on how far it is from one (original) point to another.
If you use Curve.getSpacedPoints() instead of Curve.getPoints(), you will receive equi-spaced points along your curve.
three.js R106

MIT App Inventor 2 - Why use speed?

In my simple school project, there is a character that moves using buttons. When deciding how I wanted to move a sprite I stumbled upon this dilemma, why use speed? They look pretty much identical to me so far.
Here is what I mean (the top MoveTo block and the bottom one seem the same)
of course given i set the character.speed to 10 in screen init.
What would I benefit by replacing the simple integer value with character.speed?
You can set the heading and the speed of an image sprite and the image sprite will move automatically into the direction defied by heading. Alternatively use the MoveTo method to set the image sprite to a defined x/y coordinate.
See also the documentation
Heading
Returns the sprite's heading in degrees above the positive x-axis. Zero degrees is toward the right of the screen; 90 degrees is toward
the top of the screen.
Interval
The interval in milliseconds at which the sprite's position is updated. For example, if the interval is 50 and the speed is 10, then
the sprite will move 10 pixels every 50 milliseconds.
Speed
The speed at which the sprite moves. The sprite moves this many pixels every interval.

Analog clock with moving hands with finger gesture unity3d

I am making analog clock in unity3d. I am moving hands with finger gesture. I have code for moving the hands:
void OnMouseDrag(){
mouseClickPos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
Vector3 dir = mouseClickPos - transform.position;
float angle = Mathf.Atan2(dir.y,dir.x) * Mathf.Rad2Deg;
angle = Mathf.Round(angle/6f)*6f;
hand1.transform.rotation = Quaternion.AngleAxis(angle, Vector3.forward);
}
The problem is that I want to make hour hand move angle/10 at the same time when I move minute hand(if minute hand is moving for 6 degrees, hour hand should move for 0.6 degrees), but when I make full circle with minute hand, position of hour hand resets. It should work for bot sides.
Can someone help me please?

Possible to use background gradient for D3.js graph connected to ticks on the x-axis?

I'm looking to chart some time-based data over the course of multiple days (using a simple line chart). I'd like to present the time of day as a gradient of color in the background of the line graph. Noon of each day would be white, midnight is nearly black, and all other hours in between are a smooth greyscale in between.
I can do this very, very clunkily by drawing rectangles before my lines, but it has the following problems:
1. hours without a data point don't get a rectange, leaving a gap in my background
2. the transition is not smooth, but stepped
It seems that the best way to fill in the gaps would be to latch onto the ticks along the x-axis, as those are regularly spaced regardless of the data points. Is there a way for me to apply a gradient, either CSS or SVG, along with the tick marks, that will smoothly flow from one to the other (that is, no gaps between where one gradient ends and the other begins, nor any overlap)? If I add or remove data, the gradient should change accordingly.
Any and all assistance greatly appreciated.
just define the gradient in a <def> section, and place rectangles aligned with the days you are charting. set the fill attribute to url("#the_gradient").
have a look here http://www.w3.org/TR/SVG/pservers.html

Resources