# 这个是4.31的代码,一个函数里包含了。在线上,在线左,在线右defjudgePoint(x0, y0, x1, y1, x2, y2):
juMethod =((x1 - x0)*(y2 - y0))-((x2 - x0)*(y1 - y0))if juMethod >0:print("p2 is on the left side of the line from p0 to p1")elif juMethod ==0:print("p2 is on the same line from p0 to p1")elif juMethod <0:print("p2 is on the right side of the line from p0 to p1")
turtle.penup()
turtle.goto(x0, y0)
turtle.dot(6,'red')
turtle.pendown()
turtle.goto(x1, y1)
turtle.dot(6,'red')
turtle.penup()
turtle.goto(x2, y2)
turtle.dot(6,'blue')
turtle.hideturtle()
turtle.done()
judgePoint(34,20,65,95,-50,40)
judgePoint(10,10,50,50,20,20)
judgePoint(34,20,65,95,50,25)
defleftOfTheLine(x0, y0, x1, y1, x2, y2):
juMethod =((x1 - x0)*(y2 - y0))-((x2 - x0)*(y1 - y0))if juMethod >0:print("p2 is on the left side of the line from p0 to p1")
turtle.penup()
turtle.goto(x0, y0)
turtle.dot(6,'red')
turtle.pendown()
turtle.goto(x1, y1)
turtle.dot(6,'red')
turtle.penup()
turtle.goto(x2, y2)
turtle.dot(6,'blue')
turtle.hideturtle()
turtle.done()defonTheSameLine(x0, y0, x1, y1, x2, y2):
juMethod =((x1 - x0)*(y2 - y0))-((x2 - x0)*(y1 - y0))if juMethod ==0:print("p2 is on the same line from p0 to p1")
turtle.penup()
turtle.goto(x0, y0)
turtle.dot(6,'red')
turtle.pendown()
turtle.goto(x1, y1)
turtle.dot(6,'red')
turtle.penup()
turtle.goto(x2, y2)
turtle.dot(6,'blue')
turtle.hideturtle()
turtle.done()defonTheLineSegment(x0, y0, x1, y1, x2, y2):
juMethod =((x1 - x0)*(y2 - y0))-((x2 - x0)*(y1 - y0))if juMethod <0:print("p2 is on the right side of the line from p0 to p1")
turtle.penup()
turtle.goto(x0, y0)
turtle.dot(6,'red')
turtle.pendown()
turtle.goto(x1, y1)
turtle.dot(6,'red')
turtle.penup()
turtle.goto(x2, y2)
turtle.dot(6,'blue')
turtle.hideturtle()
turtle.done()
Spring DAO的作用
Spring DAO (Data Access Object) 是 Spring 框架的一个重要组成部分,它提供了一套用于简化数据访问操作的抽象层。Spring DAO 的核心目的是使开发人员能够更容易地处理数据访问相关的异常,并提供一致的异常处理机制,同时简…