Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How does trignometry work in circles?

Asked by 8 years ago

I don't understand how they work in circles. Also How can i apply trignometry to scripting...

Some stuff I don't understand with trigonometry ----

http://wiki.roblox.com/index.php?title=Terrain_Generation

I also have no idea how this works... May someone please explain how each line works. especially the math parts ...

for i = 1,40 do

y=100*math.sin(i)

p = Instance.new("Part") p.CFrame = CFrame.new(Vector3.new(100*i, y+100, 0)) p.Size = Vector3.new(8,8,8) p.Anchored = true p.BottomSurface = "Smooth" p.TopSurface = "Smooth" p.Parent = game.Workspace p.BrickColor = BrickColor.new(26)

end

1 answer

Log in to vote
0
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
8 years ago

This question already addresses basic trigonometry. You can find many more resources with Google (both on ScriptingHelpers and off).


If you plot y = sin(x) you get a shape called a sine wave.

It's smooth, and it's bumpy. This makes it very useful for making natural looking motion, such as swaying (taking math.sin(time)) or hills (taking math.sin(x) or math.sin(z)).

You can add more sine waves of different sizes / frequencies together to get more complicated but still smooth waves.

Ad

Answer this question