The second problem is, 1 suppose actually I had p 1 and p 2 were in polar form, and I ran add points on them.
第二个点也就是,半径为3角度为1,也就是差不多在这,那么什么点,对不起。
So first we get the content subtotal; then we add some extra points for the mere fact that you're alive.
首先我们得到生活内容的部分总和;,然后再添加你活着的额外分数。
Right, and just to get a sense of this, let's look at a simple little example, so on your hand-out, you'll see I've got a little piece of code that says assuming I've got one of these points, I want to do things with it, for example I might want to add them together.
这些数组中的一个,你怎么能够知道,它是哪种类型的呢?,你怎么知道它是以笛卡尔坐标,表示的还是以极坐标,形式表示的呢?,你没有可以用来区分的东西,你没有说明这种信息,聚集实际上的意义。
So this first little piece of code right here says, ok you give me 2 points, I'll create another 1 of these lists and I'll simply take the x, sorry I shouldn't say x, I'm going to assume it's the x, the x-values are the two points, add them together, just right there, the y-values, add them together and return that list.
好,为了来认识到这一点,让我们来看一个简单的小例子,在你们的课堂手册上,你可以看到我写了一个小程序,它假设我得到了,这些点中的一些,我想对它们做一些操作,例如我想把它们加到一起,那么这里的第一小片,代码的意思是,好给我两个点,我会再创建一个数组。
Have to add some extra points.
所以你必须添加额外的分数。
.. Because we also have to add in, if we accept a valuable container theory, we also have to add in some extra positive points to take account of the fact that, well, at least you're alive or have the life or a person-- or whatever it is that you think is valuable in and of itself.
因为我们还要添加,如果我们接受有价值容器理论的话,我们还要添加一些额外的正数,你要考虑,你至少活着或者拥有人的生命-,或任何你觉得它本身有价值的东西。
Same thing with cmp, that's just saying greater than, and greater than now can apply to strings, it can apply to floats, it could apply to points, it could add other pieces into it.
是不是相等?,这跟cmp是一样的,这个只不过是说大于,大于现在可以应用于字符串,可以应用于浮点数,可以应用于点。
应用推荐