垂直線判定の途中のソースです。↓

  for(k=0;k<45;k++){
suityoku[k]=0;
}
k=0;
for(i=0;i<10;i++){
for(j=0;j<i;j++){
bekuto1x[i]=ex[i]-sx[i];
bekuto1y[i]=ey[i]-sy[i];
bekuto2x[j]=ex[j]-sx[j];
bekuto2y[j]=ey[j]-ey[j];
naiseki[k]=bekuto1x[i]*bekuto2x[j]+bekuto1y[i]*bekuto2y[j];
length1[k]=sqrt(bekuto1x[i]*bekuto1x[i]+bekuto1y[i]*bekuto1y[i]);
length2[k]=sqrt(bekuto2x[j]*bekuto2x[j]+bekuto2y[j]*bekuto2y[j]);
bunbo[k]=length1[k]*length2[k];
cos[k]=naiseki[k]/bunbo[k];
k++;
}
}
for(k=0;k<45;k++){
if(-0.1<=cos[k]&&0.1>=cos[k]){
suityoku[k]=1;
}
}

   始点(sx[],sy[])、終点(ex[],ey[])です。
直線1のベクトル(bekuto1x[],bekuto1y[])
直線2のベクトル(bekuto2x[],bekuto2y[])
内積=bekuto1x[]×bekuto2x[]+bekuto1y[]×bekuto2y[]

☆内積=cosθ|直線1||直線2|