Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Math sin expression problem-3

Enthusiast ,
Sep 26, 2024 Sep 26, 2024

Hi,

I cant write expression. But I try to. I dnt know how can I write this, because what I wrote is not giving me my expected result.

 

I want the circle to stay  beside the clock. and I linked the circle's Y position movement with the rotation of the clock hand. but the X axis of the circle is in weird position.  how should I write the expression to keep the circle's X positon fixed or whereever I want it or just beside the clock but only Y should be take its value from the rotation of the clock hand.

Please guide me.

 

sin 2.gifsin 7.gif

 

sin 8.gif

 

 

 

TOPICS
Expressions , How to
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advocate , Sep 26, 2024 Sep 26, 2024

If you want the sun to be next to the clock, adjust the X position of the sun.

You can also adjust the amplitude.

 

Translate
Advocate ,
Sep 26, 2024 Sep 26, 2024

screenshot.png

Your dimensions are separated, so you should return only a single value and not an array.

just return temp value

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 26, 2024 Sep 26, 2024

I am very slow at picking clue,  face palm, I dnt understand wht u said. what should I write? 

 

temp = Math.sin(thisComp.layer("rotating hand").transform.rotation / 5) * 100;

[temp [value]];

 

this?? 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Sep 26, 2024 Sep 26, 2024

just return:

Math.sin(thisComp.layer("rotating hand").transform.rotation / 5) * 100;

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 26, 2024 Sep 26, 2024

It doesnot work!!!   I attached kindly check!! the circle goes some weird position if I write this! 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Sep 26, 2024 Sep 26, 2024

Try this:

Math.sin(degreesToRadians(thisComp.layer("rotating hand").transform.rotation - 90)) * 100 
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 26, 2024 Sep 26, 2024

Yours last expression makes the circle comes down a lil bit. In the meantime I googled  and found another tutorial, and from there I picked the essence and this brings down the circle a lot-- 

 

 

x = thisComp.width/2;
y = Math.sin(thisComp.layer("hand").transform.rotation /10) * 400 + thisComp.height/2 + 50;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 26, 2024 Sep 26, 2024

but the x position of the circle is still fixed. cant move it freely.I wonder why its fixed.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Sep 26, 2024 Sep 26, 2024

The calculation depends on the animation you want to create with the expression I gave you.

When the "rotation hand" layer's angle is 0°, the "sun" layer is at the top, and when the angle is 180°, the "sun" layer is at the bottom.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 26, 2024 Sep 26, 2024

Yes, the rythm is very cute. The rythm is like a Monk is floating. I like it. but Its still staying at the edge, It dsnt come down and stay beside the clock!!! 😮 why!! I want the cute ocilliation from your expression but also the sun/circle needs to be beside the clock.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Sep 26, 2024 Sep 26, 2024

If you want the sun to be next to the clock, adjust the X position of the sun.

You can also adjust the amplitude.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 26, 2024 Sep 26, 2024
LATEST

😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 You are sooo erudite. THANK YOU SOOOO MUCH. 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮 😮  I am speechless. Thank you. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines