现以斜率和截距的形式给出直角坐标系上的两条直线,即double s1,double s2,double y1,double y2,分别代表直线1和2的斜率(即s1,s2)和截距(即y1,y2),请返回一个bool,判断这两条直线会不会相交(重合也算)。 测试样例: 3.14,3.14,1,2 返回:false
加载中...
import java.util.*; public class CrossLine { public boolean checkCrossLine(double s1, double s2, double y1, double y2) { // write code here } }
class CrossLine { public: bool checkCrossLine(double s1, double s2, double y1, double y2) { // write code here } };
# -*- coding:utf-8 -*- class CrossLine: def checkCrossLine(self, s1, s2, y1, y2): # write code here
class CrossLine { public bool checkCrossLine(double s1, double s2, double y1, double y2) { // write code here } }