还有 int 类型不能放到 这种集合里面
得是 Integer的
Vector() 构造一个空向量,使其内部数据数组的大小为 10,其标准容量增量为零。
Vector(Collection c) 构造一个包含指定集合中的元素的向量,这些元素按其集合的迭代器返回元素的顺序排列。
Vector(int initialCapacity) 使用指定的初始容量和等于零的容量增量构造一个空向量。
Vector(int initialCapacity, int capacityIncrement) 使用指定的初始容量和容量增量构造一个空的向量。
public class Test7 {// cos夹角=a向量点乘b向量/(a向量的模*b向量的模),这里没有考虑经度问题。
public static void main(String[] args){
int x1=3,y1=4,z1=5
int x2=6,y2=8,z2=10
double diancheng = x1*x2+y1*y2+z1*z2
double aa = Math.sqrt(Math.pow(x1, 2)+Math.pow(y1, 2)+Math.pow(z1, 2))
double bb = Math.sqrt(Math.pow(x2, 2)+Math.pow(y2, 2)+Math.pow(z2, 2))
double cos = Math.round(diancheng/(aa*bb))
System.out.println("夹角为:"+Math.acos(cos))
}
}