• Breaking News

    Saturday, December 28, 2019

    When do I use cos, sin or tan (within programming)? Computer Science

    When do I use cos, sin or tan (within programming)? Computer Science


    When do I use cos, sin or tan (within programming)?

    Posted: 28 Dec 2019 01:13 AM PST

    I know what cos, sin and tan mean when given a triangle along with the SOH CAH TOA helper method, but when I search the internet using the term "when to use cos, sin and tan" I only end up with explanations about the SOH CAH TOA things, but when I am watching some videos about The Coding Train about harmonic motion (youtube link here) he is using later in the video at 8:51 sin() in the following equation: float x = amplitute * sin((frameCount/period)*TWO_PI) but I do not understand why is he using sin() here? Why not cos() or tan()? Can we use that here? would that result in different results? If so, how would it be different?

    Maybe I don't understand it because I learned sin, cos and tan with a triangle, but I can't seem to transform those functions in my head if I had a different type of graph, since in the example I gave from the video, the guy in the iideo is using more like a wave-like graph where as

    I have a background of 8+ years of programming 4+ years professionally, but rarely have used cos and sin and especially in a way that I complete understood it (hence that I am learning it now) and this is a big area of white noise for me.

    When do I use sin(), cos() or tan() within programming?

    submitted by /u/koomenk
    [link] [comments]

    When do I use cos, sin or tan (within programming)?

    Posted: 28 Dec 2019 01:03 AM PST

    I know what cos, sin and tan mean when given a triangle along with the SOH CAH TOA helper method, but when I search the internet using the term "when to use cos, sin and tan" I only end up with explanations about the SOH CAH TOA things, but when I am watching some videos about The Coding Train about harmonic motion (youtube link here) he is using later in the video at 8:51 sin() in the following equation: float x = amplitute * sin((frameCount/period)*TWO_PI) but I do not understand why is he using sin() here? Why not cos() or tan()? Can we use that here? would that result in different results? If so, how would it be different?

    Maybe I don't understand it because I learned sin, cos and tan with a triangle, but I can't seem to transform those functions in my head if I had a different type of graph, since in the example I gave from the video, the guy in the iideo is using more like a wave-like graph where as

    I have a background of 8+ years of programming 4+ years professionally, but rarely have used cos and sin and especially in a way that I complete understood it (hence that I am learning it now) and this is a big area of white noise for me.

    When do I use sin(), sin() or tan() within programming?

    submitted by /u/koomenk
    [link] [comments]

    What is a bottleneck?

    Posted: 27 Dec 2019 01:31 PM PST

    This may seem like a trivial question at a glance, but I've been trying to get a really rigorous definition nailed down for an essay. There are a lot of colloquial definitions out there, but I'd like to find one in the literature or at least get your opinions on it. Sometimes a "bottleneck" refers to

    one process in a chain of processes, such that its limited capacity reduces the capacity of the whole chain1).

    This definition is related to production of something in business. Even so; the allusion to a serialized process is quite useful! If there is one step limiting the throughput; the throughput as a whole will be limited.

    In reference to a GPU/CPU bottleneck someone has put forth the definition as

    ... when a single part of the system limits the performance of the whole system. 2

    In this case performance is limited. Not necessarily throughput. This means a portion of the system is potentially slower at processing than the rest. In other words; that portion takes the most time.

    Throughput and latency are quite different beasts! When your process is able to handle as much throughput as is thrown at it, but it does so slowly -- you have a very different concern than if it processes only a limited amount of throughput quickly. This is where the colloquial definition begins to show shades of grey.

    Beyond the difference in metric (throughput vs latency); we've also found another shade of grey: what is it that is being processed? Of what passing through the system are we describing the throughput?

    This may seem like a silly question. In modern distributed systems, though, it's common for a frontend request to fan out into many interdependent asynchronous requests. When there are many consumer-facing application endpoints, this can be further convoluted by the interdependency of those services across usage patterns (which themselves can further fan out requests). So now are we talking about the throughput of requests by the user? Or downstream applications? Or even upstream applications?

    Turning to another definition, we can see some of that greyness abate:

    a bottleneck occurs when the capacity of an application or a computer system is limited by a single component, like the neck of a bottle slowing down the overall water flow.3)

    This seems like another clear definition. It still begs a question, though: what is a component of a computer system?

    Personally, I like the definition;

    A bottleneck is that component with respect to a particular external interface in a system of processes and channels that exhausts all of a given resource, causing the derivative of throughput on the receiving side of that external interface to approach zero.

    Does anyone else have thoughts or opinions on the matter? Does anyone know of an established, rigorous formulation for this?

    submitted by /u/eggrollinabox
    [link] [comments]

    A good minor paired with Comp Sci?

    Posted: 27 Dec 2019 10:25 AM PST

    My goal is to go into the field of something like nasa or spacex, etc. A field where it involves space exploration- maybe along the lines of computational astrophysics. Astronomy has always interested me, but Im not sure if that would be the strongest minor to pair with my comp sci major.

    Any suggestions for someone who wants to go into the aeronautics industry with a comp sci degree?

    Thanks!

    submitted by /u/indigofire1o8
    [link] [comments]

    Any free online code along(s) out there?

    Posted: 27 Dec 2019 03:06 PM PST

    Just finished up my first college course of c++ programming, REALLY enjoyed it and have read Pythons Crash Course book. Also loved it. I really enjoyed the code alongs from the book and learned a lot from that. I don't really wanna keep spending money on books and keep repeating the same ones. Any advice or tips on learning how to code small or even big one person projects would be helpful. Thank you.

    submitted by /u/Sig-X
    [link] [comments]

    About p5.js, realquick question

    Posted: 27 Dec 2019 07:37 AM PST

    Can I do a code in p5.js wherein I can make it for something like a website? some sort of that there is a link that when someone else open, my work will be projected that is not in the platform of p5.js where the actual codes isn't there?

    submitted by /u/patricksevilla
    [link] [comments]

    No comments:

    Post a Comment