# 计算不在相机视野范围内的模型的方法

```#Get the point of camera.

camDirection     = cmds.camera( activeCamera , q = True , worldCenterOfInterest = True )

camPosition      = cmds.camera( activeCamera , q = True , position = True )

#Get the vector of camera.

camUpDirection   = cmds.camera( activeCamera , q = True , worldUp = True )

camDirec         = [camDirection[i] - camPosition[i] for i in range(3)]

#Get the parameters of lens.

F = cmds.camera(activeCamera , q = True , focalLength = True)

H = cmds.camera(activeCamera , q = True , horizontalFilmAperture = True)

V = cmds.camera(activeCamera , q = True , verticalFilmAperture = True)

Hangle = math.degrees( math.atan2(H*25.4/2, F) )

Vangle = math.degrees( math.atan2(V*25.4/2, F) )```

```def calculateAngle(somepoint):
pointDir = [somepoint[i]   - camPosition[i] for i in range(3)]

camSideDirection = [camDirec[1]*camUpDirection[2]-camDirec[2]*camUpDirection[1],camDirec[2]*camUpDirection[0]-camDirec[0]*camUpDirection[2],camDirec[0]*camUpDirection[1] - camDirec[1]*camUpDirection[0]]

#the angle between two vector.
VerticAngle = math.degrees(math.asin((camUpDirection[0]*pointDir[0] + camUpDirection[1]*pointDir[1] + camUpDirection[2]*pointDir[2])/(math.sqrt(camUpDirection[0]*camUpDirection[0] + camUpDirection[1]*camUpDirection[1] + camUpDirection[2]*camUpDirection[2])*math.sqrt(pointDir[0]*pointDir[0] + pointDir[1]*pointDir[1] + pointDir[2]*pointDir[2] ))))

#the angle between two vector.
horizoAngle = math.degrees(math.asin((camSideDirection[0]*pointDir[0] + camSideDirection[1]*pointDir[1] + camSideDirection[2]*pointDir[2])/(math.sqrt(camSideDirection[0]*camSideDirection[0] + camSideDirection[1]*camSideDirection[1] + camSideDirection[2]*camSideDirection[2])*math.sqrt(pointDir[0]*pointDir[0] + pointDir[1]*pointDir[1] + pointDir[2]*pointDir[2] ))))

#the angle between two vector.
FrontAngle  =camDirec[0]*pointDir[0] + camDirec[1]*pointDir[1] + camDirec[2]*pointDir[2]

if abs(horizoAngle) >Hangle:
return False
elif abs(VerticAngle) >Vangle:
return False
elif FrontAngle< 0:
return False
else:
return True```

## The time machine-时间机器计算差值（二十四小时内）

The time machine-时间机器计算差值(二十四小时内):输入hours.minutes,1代表AM,0代表PM. //The time machine-时间机器计算差值(二十四小时内) #include<iostream> int computeDifference(int startHours, int startMinutes, bool startIsAM,int endHours,   int endMinutes,   bool endIsAM); int main()

## 机器学习之深度学习常用的模型和方法

Deep Learning的常用模型或者方法 AutoEncoder自动编码器 Deep Learning最简单的一种方法是利用人工神经网络的特点,人工神经网络(ANN)本身就是具有层次结构的系统,如果给定一个神经网络,我们假设其输出与输入是相同的,然后训练调整其参数,得到每一层中的权重.自然地,我们就得到了输入I的几种不同表示(每一层代表一种表示),这些表示就是特征.自动编码器就是一种尽可能复现输入信号的神经网络.为了实现这种复现,自动编码器就必须捕捉可以代表输入数据的最重要的因素,就像PCA