479
Relaxing (lemmy.world)
you are viewing a single comment's thread
view the rest of the comments
[-] johannesvanderwhales@lemmy.world 21 points 2 months ago

Never really understood people who say they don't use algebra. I use it very regularly.

[-] HubertManne@kbin.social 4 points 2 months ago

I was thinking this myself. sin, cos, tan. Have not used. I have use euler coordinates so thats something but really solve for x is the most advanced thing I have used outside of school. mmmm actually I guess some statistics like stadard deviation.

[-] johannesvanderwhales@lemmy.world 2 points 2 months ago

I recently had to do a two variable equation because I was using a recipe that called for a specific milk fat percentage by mixing cream and milk, and my cream was heavier than what it needed. That was really stretching the limits of what math I remember.

[-] refalo@programming.dev 2 points 2 months ago

Programmer for 25 years. Only time I have ever used math more complicated than simple multiply/divide was... actually never.

That one time when I copy/pasted a formula for linear interpolation, was still just multiplication and division. And I still have no idea how it works.

I've even done OpenGL and graphics programming and still haven't needed any algebra/trig/etc, although I don't do complex 3D rendering or physics or anything like that.

I wish I knew how to do cool programming stuff like draw circles and waves and stuff though, but I've never seen a tutorial that didn't go WAY over my head immediately.

[-] FooBarrington@lemmy.world 7 points 2 months ago* (last edited 2 months ago)

Drawing a circle is actually pretty simple! Say we want to draw one with:

  • radius r=5
  • center C=(0,0)
  • 1000 points

The logic would be:

for (let i = 0; i < 1000; i++) {
    // full circle is made up of 2 * PI angles -> calculate current loop angle
    const angle = (2 * Math.PI) * (i / 1000)
    const x = r * Math.cos(angle)
    const y = r * Math.sin(angle)
    drawPixel(x, y)
}

The circle starts being drawn at (5, 0). As y approaches -5, x gets smaller until it hits 0. Then x approaches -5 and y approaches 0, and so on.

[-] Valmond@lemmy.world 1 points 2 months ago

That won't work well ;-) it will draw 1000 pixels whatever the circumference!

A good start though, for sure.

[-] FooBarrington@lemmy.world 1 points 2 months ago

It's just meant to be a simple example. If someone says other tutorials quickly go over their head, it's not a good idea to introduce unnecessary concepts to start with.

this post was submitted on 01 May 2024
479 points (89.6% liked)

Funny: Home of the Haha

4841 readers
731 users here now

Welcome to /c/funny, a place for all your humorous and amusing content.

Looking for mods! Send an application to Stamets!

Our Rules:

  1. Keep it civil. We're all people here. Be respectful to one another.

  2. No sexism, racism, homophobia, transphobia or any other flavor of bigotry. I should not need to explain this one.

  3. Try not to repost anything posted within the past month. Beyond that, go for it. Not everyone is on every site all the time.


Other Communities:

founded 1 year ago
MODERATORS