Пікірлер

  • @zhixinhuang4084
    @zhixinhuang4084Сағат бұрын

    What will you do? A B C or D? A: You can always go to the park B: You can always get to work on time C: You can always make a PERFECT triangle D: You go to Paris every year E: you ALWAYS get what you want

  • @sensorer
    @sensorer8 сағат бұрын

    Answer: Central Limit Theorem

  • @astroorbis
    @astroorbis9 сағат бұрын

    no way you have less than 1k subs

  • @guush890
    @guush89012 сағат бұрын

    instead of math.pow, you can do 2**-n, no idea if it has the same time complexity tho

  • @mr.dragon.purple9209
    @mr.dragon.purple920915 сағат бұрын

    0:15 A

  • @zian01000
    @zian0100018 сағат бұрын

    Then we need cosine................. Mom our neighbour is destrying his house again.

  • @zian01000
    @zian0100018 сағат бұрын

    A

  • @Anife69
    @Anife6922 сағат бұрын

    peak cinema of math

  • @derpaboopderp1286
    @derpaboopderp128622 сағат бұрын

    :(

  • @remopellegrino8961
    @remopellegrino8961Күн бұрын

    Try at least have some lookup for values that return 0 as a sine or cosine... Coding is more than happy paths

  • @somerandomdragon558
    @somerandomdragon558Күн бұрын

    sin(x)=x Its close enough.

  • @valcubetaa
    @valcubetaaКүн бұрын

    When I saw the brackets I died

  • @j7ndominica051
    @j7ndominica051Күн бұрын

    I had to stop watching a few minutes in because I couldn't focus afraid of a scene with wasted eggs and phone books sudddenly appearing.

  • @o_s-24
    @o_s-24Күн бұрын

    Why not use Taylor series approximations?

  • @orpezo
    @orpezoКүн бұрын

    ok but you didn't say "why"

  • @TheUnqualifiedTutor
    @TheUnqualifiedTutorКүн бұрын

    sorry :(

  • @chaklee435
    @chaklee435Күн бұрын

    you asked "Why", and then answered "What". Hm.

  • @georgephilippe4028
    @georgephilippe4028Күн бұрын

    The whole point of the original CORDIC (published by Jack Volder in 1957ish) was to replace computationally heavy/expensive multiplication and division in old memory-poor computers with additions/subtractions and some table lookups. Logs were also possible. Though based on some obscure 17th Century mathematics it was still a damn impressive algorithm. The code here would not have worked efficiently on early computers and calculators. In fact, it would have defeated the whole point of the original CORDIC. Interesting, though.

  • @JohnDlugosz
    @JohnDlugoszКүн бұрын

    From the thumbnail, I thought it would be how modern calculators give symbolic answers for special cases when it recognizes them. IAC, what you described is called the CORDIC algorithm. It needs one iteration per bit of the answer, so 55 iterations seems right as that matches the mantissa of a double precision floating point value. CORDIC _can_ be implemented using only addition, subtraction, bit shifts, and table lookups -- no multiplication or division. Your code doesn't exploit this, and in fact uses division gratuitously. (division being horribly slow even on modern CPUs). This makes it the preferred algorithm for low-end calculators that use 8-bit microcontrollers. For a more capable CPU, the Taylor series takes fewer iterations and will need fewer as the angle is smaller.

  • @charlieborchardt2066
    @charlieborchardt20662 күн бұрын

    "But wait, that requires cos and sin." "Aaaarerggghg!!!!!!!!!" Got me dying. 💀 Eggs in a blender.

  • @johnplays9654
    @johnplays96542 күн бұрын

    С) Taylor series

  • @jojo989GD
    @jojo989GD2 күн бұрын

    everything good before the programming part

  • @jangelbrich7056
    @jangelbrich70562 күн бұрын

    And I thought for half a century that mathematicians and programmers have zero emotions ...

  • @andrasravasz8491
    @andrasravasz84912 күн бұрын

    Really love your videos! Keep it up and you'll hit hundred thousands fast. Your humour is very good. Especially loved it in your "How sin is calculated in calculators"

  • @Snurklll
    @Snurklll2 күн бұрын

    truely an alpha man

  • @honsthebronze
    @honsthebronze2 күн бұрын

    ERORR: division by zero line 7 and 13

  • @hotmole7621
    @hotmole76212 күн бұрын

    who the sigmas are and who is mewing 🗣️🗣️🗣️

  • @mariobabic9326
    @mariobabic93262 күн бұрын

    calculators actually have tables with all the sin values with the maximum precision they need. they dont directly calculate sin() because of perfomance

  • @arshamshayan
    @arshamshayan2 күн бұрын

    The percentage of men mewing is quantum bogo sort bell curve distribution 79.01$

  • @two697
    @two6972 күн бұрын

    No

  • @user-lu9fg7pc9q
    @user-lu9fg7pc9q2 күн бұрын

    11:00 this jump scared me slightly

  • @MCPicoli
    @MCPicoli3 күн бұрын

    How do you get rid of the atan() function in the code? We're not supposed to use trig functions here, unless there is a video explaining how to approximate atan() without other trig functions!

  • @jakeaustria5445
    @jakeaustria54453 күн бұрын

    Hello, haha. I actually made a general algorithm for this. Distances of point to point, line to line, plane to plane, point to line, point to plane, and line to plane. I also used the vector summation representation. I then imagine that I picked two points from the two objects. I then consider all of those possible pair of points. Calculate their distance. I will then use multivariable calculus to get the minimum distance. After that, I calculate back for the pair of points that produced this minimum distance(the gradient is equated here to 0 so I don't know yet the minimum distance). And then solve for the vector between those two points and calculate the norm. I hate calculating our grade 12 lesson about 3d space and distances of two objects, so I created this algorithm so I can just plugin and done. Haha. I also used this technique in Time Series Analysis particularly on the pth-difference equations prior to this distance project. It's a very useful and powerful technique.

  • @LaMirah
    @LaMirah3 күн бұрын

    7:54 Python uses the same double-asterisk operator as FORTRAN for exponentiation, so 2ⁿ would be written as `2 ** n`. Math.pow() always returns floating point numbers as a result, whereas the double-star operator will return integer values when appropriate.

  • @LethalChicken77
    @LethalChicken773 күн бұрын

    My favorite part is how it still uses a trig function

  • @janpaul74
    @janpaul742 күн бұрын

    indeed, how do we get rid of the atan for f**k sake? ;-)

  • @Tof0986
    @Tof09862 күн бұрын

    @@janpaul74 Thought the same first, then concluded that these are arctan of always the same values, then it can be hardcoded, I guess.

  • @Tovarris
    @TovarrisКүн бұрын

    @@janpaul74 You can use taylor series to approximate trig functions as a polynomial. For example cosx = 1 - (x^2)/2! + (x^4)/4! - (x^6)/6! + ... Look up taylor series for more info. I believe they are used to approximate trig functions and also other tricky functions like e^x as well. It is also how exact values of these functions were found before calculators.

  • @viboxact
    @viboxact3 күн бұрын

    For the first problem, C = 4, not 2

  • @MangoNutella
    @MangoNutella3 күн бұрын

    Your Python syntax hurts 😬😅

  • @billr3053
    @billr30533 күн бұрын

    Better to pronounce the sign() function as SIGNUM. Not “sine” - because that would confuse it with sin().

  • @AmaroqStarwind
    @AmaroqStarwind4 күн бұрын

    Wtf was that Intro?

  • @itz_mario.
    @itz_mario.4 күн бұрын

    or simply use binomial expansion of trig functions, define the function, replace the x with the variable name in the function parameter, keep writing as many terms as you can then you will get almost identical results to real values

  • @wetwillyis_1881
    @wetwillyis_18814 күн бұрын

    Imagine if Aliens come down and see us doing this, and just pull out a protractor and say “guys, why aren’t you just using these with scale models?”

  • @wetwillyis_1881
    @wetwillyis_18814 күн бұрын

    Imagine if a business major sees this. I think they’ll explode. Math majors may be sad, depressed, lonely, and overworked, but at least we can understand shit like this!

  • @xbia1
    @xbia14 күн бұрын

    Iteration isn't the fastest method and there's a chance that change never reaches zero because of finite precision. It's better to use a polynomial or rational function. See Computer Approximations by J.F. Hart et al.

  • @r3apxer
    @r3apxer4 күн бұрын

    Ever heard of a Taylor series?

  • @Zadik
    @Zadik4 күн бұрын

    import math # Get the angle from the user (assuming degrees) angle = float(input("Enter the angle in degrees: ")) # Convert degrees to radians (optional, for more precise calculations) # radians = math.radians(angle) # Calculate sine, cosine, and tangent sine = math.sin(angle) cosine = math.cos(angle) tangent = math.tan(angle) # Print the results (consider formatting for readability) print(f"sin({angle:.2f}°) = {sine:.4f}") print(f"cos({angle:.2f}°) = {cosine:.4f}") print(f"tan({angle:.2f}°) = {tangent:.4f}")

  • @mrtnsnp
    @mrtnsnp4 күн бұрын

    I do get some weird values. π/4 stops after 2 iterations, but ends up at the really wrong value (0.6072529350088812 instead of 0.7071067811865475). And cos(0) is really wrong, after 1 iteration. For π/2 the sin and cos are fine, but understandably the tan value is a bit wonky.

  • @GeorgiMomchilov
    @GeorgiMomchilov4 күн бұрын

    The most underrated chanell on the platform

  • @mathematicalmachinery7934
    @mathematicalmachinery79344 күн бұрын

    8:03 that's not "to the power of", that's "xor". XOR is a weird binary thingy, if you want "to the power of", use ** instead of ^

  • @alguem24
    @alguem244 күн бұрын

    I really liked the video but the python part made we want to bang my head

  • @rieder990
    @rieder9904 күн бұрын

    Good video!

  • @rifatbhuiyan2543
    @rifatbhuiyan25434 күн бұрын

    I thought calculators use Taylor's series. What's wrong with that?

  • @mrshmister173
    @mrshmister1734 күн бұрын

    Finally, a channel does a better explanation of the Cordic algorithm than just "rotating the vector" to approximate a trig function, When rotations require trig functions. Brilliant video.