Let's test it in all possible combinations of x and y and see if we get the right answer.
来测试并看看,返回的结果正确不正确。
If its in Cartesian form I'll pass in an x and y and compute what a radius and angle is.
来得到的这个点,我都可以得到这个点的,全部的这种信息。
I'm simply saying swap X with Y, but this 2 won't work, because where are X and Y defined?
我只简单地说交换X和Y,但是这两行不起作用,因为X和Y是在哪里定义的呢?
It's very important that x and y are human constructs and we're not wedded to any of them.
很重要的是 x 轴和 y 轴是人为设定的,且我们不能拘泥于它们
So again, if you're at X and the winner is at Y, it hurts you minus the distance between X and Y, in terms of your unhappiness, about having a winner who's far away from you, winning.
再说一遍,如果你在X且获胜者在Y,它对你的伤害等于X和Y之间的距离,即,当选人和你之间的距离,这就是你在选举之后郁闷的程度
Remember, we don't do a one-to-one correlation, because p x and p y are some linear combination of the m plus 1 and m minus 1 orbital.
记住,我们不需要把它们一一对应,因为px和py轨道是,m等于正负1轨道的线性组合。
x y z And I have another equation f of x, y, z.
若我有另一个方程。
All right, c p 1 dot y, x I've said assign that to the value 2, 2,0. So now c p 1 has inside of it an x and y value.
一个特定的版本,我现在命名了一个内置变量,并给它赋值了,我刚刚做的也就是给它。
Where x and y are floats.
我需要很多个引号,好。
But here, if I decide I'm going to store things not in x and y, but with some other set of names, for example, I've gotta go back into these pieces of code that use the points, and change them. So I've lost modularity.
除了要改下借口,但是这里,如果我决定,我不把值放在x和y中,而是和其他一些变量名进行绑定,例如这样的话,我就得回到使用这个点的代码,那儿去做更改了。
swap If main wants to give access to swap to x and Y, it just has to tell swap where x and y are.
如果main函数想要对x和y使用,只要告诉swap,x和y在哪里。
x and get the values of x and y attached to this thing and return them to me.
和y值然后把它们返回给我,It’s,going,to,go,off,这就是我想要的东西,我想要我的类里面有一些方法。
And you can very quickly take this feature to an extreme 10 and start putting X and Y and A and B and 10 and all your variables up top because it would seem to solve all of your problems and stop all of your thinking, but it's generally not a good thing.
你可能迅速地使这个特征成为一个极端,开始把X和Y和A和B和0,和所有的变量都放在最前,因为好像它可以,解决你的所有问题,并中止你的想法,但通常这不是一件好事情。
If you go to another neighboring country, that's what they think is naturally x and y.
如果你们到了另一个相邻的国家,这就成了他们所惯用的 x 和 y 方向
You can either think of it as an arrow and imagine the arrow, or you can reduce it to a pair of numbers, x and y.
你既可以用有向线段来表示,也可以用一组数字来表示,x 和 y
And I think in the polar one I said, if, what did I do there, I said, yeah, again if the x and y are greater than the other one, I'm going to return them to it.
然后我要返回一些值,我认为在极坐标的形式下我说过,如果,我在这里做了什么来着,我说过,对,再说一次,如果x和y坐标。
Now, unlike high school math or in algebra Z where you call things X and Y and Z, in programming, in computer science, you're actually dealing with humans where it's useful to have a variable name that's more descriptive than X and Y and Z.
不像高中数学或者代数中,称为X和Y和,在程序设计和计算机科学里,你实际上是在和人打交道,在这里有个描述性比xyz更强的,变量名称是很重要的。
Just write a program to find the max of x and y.
就写个程序找出浮点数x和y中的最大值吧。
There is no reason why x and y are nailed in absolute space.
轴和 y 轴在绝对空间中并不固定
i and j are unit vectors in the x and y directions.
和 j 分别是 x 和 y 方向上的单位矢量
If it's in polar form I passed in a radius and angle and I'll compute what the x- and y- value is.
以及半径和角度,但是现在是这样的,不管我是以哪种形式。
px 2py So we need to fill all the way up to the pi 2 p x, and the pi 2 p y.
我们需要填到。
Y Why don't I say int temp gets X. Let's say Y oh, sorry, X gets Y and then Y gets temp, this 2 would fail.
为什么我不说明,int,temp,=,X,让我们说明,哦,对不起,X=Y,然后,Y=temp,这两行将失败的。
Notice in the class definition here, is there, this is the first thing that's got called, and I just called with the value for x and the value for y, and it went off and did something for me.
就在这里,这是第一个被调用的东西,我用x的值和y的值调用了它,然后这个方法继续进行,并为了做了一些操作。
And I originally decided I was going to have as points, it's going to have internal values of an x and a y.
写了一堆代码,然后我以开始决定,是要把值放到点里面的,点有内部的x坐标和y坐标。
It's easy to think of a point as just a list of an x- and a y- coordinate.
或者说有两个元素的数组,把一个点认为是含有x坐标。
Somebody who is a math major, tell me how to solve out for the X and the Y.
哪个数学专业的同学,来告诉大家如何解出X和Y的值
It says, take value of y and value of x, add them together, y and create that as the new value of y.
把x和y的值,加到一起,然后把和赋值给。
This now has, gee, a funny thing, x it says IF x is less than y AND x is less than z, then do something.
代码现在有,啊,一个有趣的东西,代码先是判断x是不是小于y并且,是不是小于z,然后做一些事情。
So, we can have the 2 p x, 2 p y, and 2 p z orbitals.
所以我们有2个px2个py2个pz轨道。
应用推荐