As you build these kinds of simulations, or anything like this, you need to think through whether things should be multiplicative or additive.
正如你建立各种仿真程序,或者类似的仿真程序时,你应该去想一想,他们应该是用加法还是用乘法。
And the way I remember that is I put a little cross here, and then I make that the plus end.
我还记得要,在箭头尾部打个叉,然后让加法完结了。
But let's suppose that I realize that I'm doing a lot of addition in my programs, and I actually want to factor out what seems to becoming a lot of copy, paste.
但是假如我在程序中做了很多加法,我实际上想要提出那些,复制粘贴的东西。
And he quite correctly, because he's more senior than I am, more experienced than I am, said it's actually a good thing.
你可以用加法来加浮点数,他很明显是正确的,因为他比我年长些,比我更有经验些。
This is how you get the rules for adding a vector to another vector, then taking a vector and multiplying it by some constant.
以上这些就是矢量加法的法则,以及数乘矢量的法则
As Dero says, " "soul grows more by subtraction than by addition", by getting rid of these limitations, limitations that are preventing us from fulfilling our potential.
就像俗话说的那样,“做减法比做加法让灵魂成长得更快,减法包括除去那些,阻碍我们发挥潜能的限制。
Oh, and actually before you skip your page in the notes, I realized I should write out for you what the addition is to start with. So, when we're combining two waves, 1sb what we have is 1 s a that we're adding together with 1 s for b, the second atom.
在你们翻过这页讲义之前,我觉得我应该写出加法,当我们把两个波函数放在一起时,我们用1sa加上,第二个原子。
But what I do? I just separated, do I do the addition first or do the multiplication first?
那么我该怎么办?我就是要做一个分割,应该先做加法呢,是先做乘法呢?
You might recall from grade school sometimes you put things in parentheses so that your addition happens first, then your multiplication, otherwise multiplication would happen by default first.
你们可能会想起小学时,将一些加法表达式,放在圆括号里,这样加法可以先计算,然后是乘法,否则,乘法默认先发生。
In which I said, you know, I didn't like the fact that things like plus are overloaded, because you can use plus to add strings, you can use plus to add numbers, you can use plus to add floats.
那个玩笑是这样的,你们懂得,我并不喜欢,加法被重载这样的事情,但是你可以用加法,来对字符串进行合并,你可以用加法来加数字。
If you're writing a one line function, whose sole purpose in life is addition, and, clearly, this is about addition, well, then it's, in fact, A reasonable to use a shorter symbol like A, but I do have to specify it's type.
如果你在写一个一行的函数,它唯一的目的是,做加法,显然这是关于加法的,好的,实际上,用一个短的标识符是合理的,像,但是我必须指明它的类型。
And I'm going to do it only using multiplication and addition and some simple tests. All right?
我只能用乘法和加法,以及一些小测试来解决这个问题?
You add them all up algebraically, keeping track of their sign, and that's the total force.
你再对这些力做代数加法,注意符号,就求出合力了
I keep seeing addition and I keep just copying my code, copying my code.
我总是看到加法,我一直复制我的代码,复制代码。
This is when the addition gets very publically awkward so.
这时候还在做加法计算,当众出丑了吧。
Okay, so that tells you how to add two vectors and get a sum.
这就是矢量的加法法则
Simple, seems like, at least addition.
很简单起码是加法。
It doesn't matter the sequence in which you add the two vectors.
在做两个矢量的加法时无所谓相加的顺序
You know that's true for ordinary numbers, right?
这对于普通数字的加法成立,不是吗
This is the rule for adding vectors.
这就是矢量的加法法则
y-- >> It adds, like, x to y -- >> David: Okay, good.
>,它会做加法,像x加-,>>,大卫:嗯,好的。
Things like addition and multiplication, which we saw not only apply to numbers, but we can use them on things like strings and we're going to come back to them again.
就像加法和乘法,我们已经学习过,它们不仅仅可以应用于数字,还可以用到字符串上,我们今天还会再讲讲。
And that's why, I ended up using a multiplicative factor, rather than an additive factor.
这也是为什么,我最后使用一个倍增因子,而不是用一个加法因子。
Now what I'd like to do, every time I find a divisor I'd like to gather it together. So I'm going to create a tuple of one element, the value of i.
那么我就会去创建只包含一个元素的元组,也就是这个除数了,然后,啊,很好,这里是加法重载的一个很糟糕的应用。
Okay, so the rule for adding the two vectors is, you draw the first one and at the end of that first one, you begin the second one.
矢量的加法法则就是,先画出第一个矢量,然后在它的终点,再画第二个矢量
It is clear that that vector is the sum of that vector and that vector, by the rules of vector addition, because that plus that is equal to the A.
这个矢量是这个两个矢量之和,根据矢量加法的法则,因为这两个矢量相加就等于 A
应用推荐