当前位置: 首页 > news >正文

怎么做自动跳转网站seo网络优化推广

怎么做自动跳转网站,seo网络优化推广,宜宾公司做网站,河南省豫建设计院网站希望这个下集里能有完整的代码 一、containsPoint实现 先从网上找一下Statement expected, found Py:DEDENTTAB还是空格呢??小小总结如何拆分矩形的四个点呢.我们来小小的测试一下这个函数结果出在哪里呢???修改完成variable in function should be lowercase 函数变量应该…

在这里插入图片描述

希望这个下集里能有完整的代码

一、containsPoint实现

      • 先从网上找一下Statement expected, found Py:DEDENT
      • TAB还是空格呢??
      • 小小总结
      • 如何拆分矩形的四个点呢.
        • 我们来小小的测试一下这个函数
        • 结果
        • 出在哪里呢???
        • 修改完成
        • variable in function should be lowercase 函数变量应该小写

mac系统里似乎不接受我们的驼峰命名,所以这个函数应该是contains_point

在这里插入图片描述

代码段如下,出现的问题0.05后Statement expected, found Py:DEDENT,完又遇到这个哥们了

    def get_x(self):return self.__xdef get_y(self):return self.__y# 实现另一个矩形的x,y坐标与当前矩形x,y对比def contains_points(self, other_x, other_y):a_t_valid = other_x - self.__xb_t_valid = other_y - self.__ya = (pow(a_t_valid, 2) + pow(b_t_valid, 2)) * 0.05

在这里插入图片描述

二、我要解决这个哥哥

      • 先从网上找一下Statement expected, found Py:DEDENT
      • TAB还是空格呢??
      • 小小总结
      • 如何拆分矩形的四个点呢.
        • 我们来小小的测试一下这个函数
        • 结果
        • 出在哪里呢???
        • 修改完成
        • variable in function should be lowercase 函数变量应该小写

先从网上找一下Statement expected, found Py:DEDENT

语句预期,发现Py:DEDEN Statement expected, found Py:DEDENT

在这里插入图片描述
AI解释的.我看不懂.估计是阅读恐惧问题.
我想想从里面找找我能看到的地方吧

TAB还是空格呢??

记得有人说.用空格的程序员很宝贵,要比用TAB的宝贵.看来这句话今天可以试试了

在这里插入图片描述

画圈的地方是我用空格键一个个按出来的.而不是用TAB按出来的.

小小总结

看来多用空格按钮

三、如何在矩形中对比

      • 先从网上找一下Statement expected, found Py:DEDENT
      • TAB还是空格呢??
      • 小小总结
      • 如何拆分矩形的四个点呢.
        • 我们来小小的测试一下这个函数
        • 结果
        • 出在哪里呢???
        • 修改完成
        • variable in function should be lowercase 函数变量应该小写

圆形我们以半径的长度为x,y的对比.矩形怎么办呢??
我之前已经有个办法了.那么我要去找一下第4章的兄弟帮忙

我调用了24.2第11次做的4.31题的代码

  def count_point_judge(r1x, r1y, r2x, r2y, r3x, r3y):judgeLine1 = ((r1x - r2x) * (r3y - r2y)) - ((r3x - r2x) * (r1y - r2y))if judgeLine1 < 0:print("P2 x{} y{} is on the left side of the line from P0 to P1)".format(r3x, r3y))elif judgeLine1 > 0:print("P2 x{} y{} is on the right side of the line from P0 to P1)".format(r3x, r3y))elif judgeLine1 == 0:print("P2 x{} y{} is on the same line from P0 to P1)".format(r3x, r3y))

我似乎看到了希望.但是我发现它是用已知的2个点组成的线段对比另一个已知的点.

四、兜兜转转的我要拆分矩形的四个点

      • 先从网上找一下Statement expected, found Py:DEDENT
      • TAB还是空格呢??
      • 小小总结
      • 如何拆分矩形的四个点呢.
        • 我们来小小的测试一下这个函数
        • 结果
        • 出在哪里呢???
        • 修改完成
        • variable in function should be lowercase 函数变量应该小写

本来就是一个偷懒的完成矩形就可以了.但是.但是看来玩要好好的拆分了.

如何拆分矩形的四个点呢.

我们应该利用当前的x,y坐标和长宽来计算四个点的坐标.

# 求得最右边的代码
(x_1 - width_r / 2, height_r / 2 + y_1)

好我们建立一个计算的函数吧

五、计算矩形四个x,y点的con_po登场

      • 先从网上找一下Statement expected, found Py:DEDENT
      • TAB还是空格呢??
      • 小小总结
      • 如何拆分矩形的四个点呢.
        • 我们来小小的测试一下这个函数
        • 结果
        • 出在哪里呢???
        • 修改完成
        • variable in function should be lowercase 函数变量应该小写

   def con_po(self):rx1, ry1 = self.__x - self.__width / 2, self.__height / 2 + self.__yrx2, ry2 = abs(rx1) + self.__width, ry1rx3, ry3 = rx2, ry2 - self.__heightrx4, ry4 =abs(rx1)-self.__height, ry3turtle.penup()turtle.goto(rx1,ry1)turtle.pendown()turtle.goto(rx2,ry2)turtle.goto(rx3,ry3)turtle.goto(rx4,ry4)turtle.hideturtle()turtle.done()
我们来小小的测试一下这个函数

def main():x1, y1, width1, height1 = eval(input("Enter x1,y1,width1,height1: "))r1 = Rectangle2D(x1, y1, width1, height1)r1.con_po()main()
结果

在这里插入图片描述
别慌,我们把点标出来.

# 增加一段打印代码来看看这4对坐标的数值
print(f"x1: {rx1}, y1: {ry1}")
print(f"x2: {rx2}, y2: {ry2}")
print(f"x3: {rx3}, y3: {ry3}")
print(f"x4: {rx4}, y4: {ry4}")

以下数据为例.按我的代码计算结果截图
x1, y1, width1, height1 = 9,1.3,10,35.3

在这里插入图片描述

出在哪里呢???

我怀疑是x4的计算上.我们合计一下.

        # 我是不是不应该进行这样的减法rx4, ry4 =abs(rx1)-self.__height, ry3
修改完成
 def con_po(self):rx1, ry1 = self.__x - self.__width / 2, self.__height / 2 + self.__yrx2, ry2 = abs(rx1) + self.__width, ry1rx3, ry3 = rx2, ry2 - self.__heightrx4, ry4 = rx1, ry3print(f"x1: {rx1}, y1: {ry1}")print(f"x2: {rx2}, y2: {ry2}")print(f"x3: {rx3}, y3: {ry3}")print(f"x4: {rx4}, y4: {ry4}")turtle.penup()turtle.goto(rx1, ry1)turtle.dot(3, "blue")turtle.pendown()turtle.goto(rx2, ry2)turtle.dot(3, "blue")turtle.goto(rx3, ry3)turtle.dot(3, "blue")turtle.goto(rx4, ry4)turtle.dot(3, "blue")turtle.goto(rx1, ry1)turtle.hideturtle()

在这里插入图片描述
现在我们获得了坐标接下来我们应该如何把con_po融入到contains_points
在这里插入图片描述

variable in function should be lowercase 函数变量应该小写

六、结合后的contains_points

      • 先从网上找一下Statement expected, found Py:DEDENT
      • TAB还是空格呢??
      • 小小总结
      • 如何拆分矩形的四个点呢.
        • 我们来小小的测试一下这个函数
        • 结果
        • 出在哪里呢???
        • 修改完成
        • variable in function should be lowercase 函数变量应该小写

def contains_points(self,other_x,other_y):rx1, ry1 = self.__x - self.__width / 2, self.__height / 2 + self.__yrx2, ry2 = abs(rx1) + self.__width, ry1rx3, ry3 = rx2, ry2 - self.__heightrx4, ry4 = rx1, ry3judge_line1 = ((rx1 - rx2) * (other_y - ry2)) - ((other_x - rx2) * (ry1 - ry2))judge_line2 = ((rx2 - rx3) * (other_y - ry3)) - ((other_x - rx3) * (ry2 - ry3))judge_line3 = ((rx3 - rx4) * (other_y - ry4)) - ((other_x - rx4) * (ry3 - ry4))judge_line4 = ((rx4 - rx1) * (other_y - ry1)) - ((other_x - rx1) * (ry4 - ry1))if judge_line1 > 0 and judge_line2 >0 and judge_line3 >0 and judge_line4 >0:print(f" r2 x: {other_x} y: {other_y} is in r1")else:print(f" r2 x: {other_x} y: {other_y} is not in r1")

七、本题最后的代码

      • 先从网上找一下Statement expected, found Py:DEDENT
      • TAB还是空格呢??
      • 小小总结
      • 如何拆分矩形的四个点呢.
        • 我们来小小的测试一下这个函数
        • 结果
        • 出在哪里呢???
        • 修改完成
        • variable in function should be lowercase 函数变量应该小写

这次偷懒了.就不再分析下面的问题了.但是代码写全了


class Rectangle2D:# 初始化当前矩形的信息def __init__(self, x, y, width, height):self.__x = xself.__y = yself.__width = widthself.__height = height# 获得当前矩形的面积def get_area(self):return self.__width * self.__height# 获得当前矩形的周长def get_perimeter(self):return (self.__width + self.__height) * 2# 装一下,打印该矩形的x,y和长宽def print_text(self, name):print(f"Enter x{name}, y{name}, width{name}, height{name}: {self.__x}, {self.__y}, {self.__width},"f" {self.__height}")# 绘制当前矩形def draw_rec1(self):turtle.penup()turtle.goto(self.__x, self.__y)turtle.dot(6, "blue")turtle.goto(self.__x - self.__width / 2, self.__height / 2 + self.__y)turtle.pendown()turtle.forward(self.__width)turtle.right(90)turtle.forward(self.__height)turtle.right(90)turtle.forward(self.__width)turtle.right(90)turtle.forward(self.__height)turtle.hideturtle()turtle.done()# 绘制当前矩形和另一个矩形def draw_rec2(self, other_rec):x_1 = other_rec.__xy_1 = other_rec.__ywidth_r = other_rec.__widthheight_r = other_rec.__heightturtle.penup()turtle.goto(self.__x, self.__y)turtle.dot(6, "black")turtle.goto(self.__x - self.__width / 2, self.__height / 2 + self.__y)turtle.pendown()turtle.forward(self.__width)turtle.right(90)turtle.forward(self.__height)turtle.right(90)turtle.forward(self.__width)turtle.right(90)turtle.forward(self.__height)turtle.left(270)turtle.penup()turtle.goto(x_1, y_1)turtle.dot(6, "blue")turtle.goto(x_1 - width_r / 2, height_r / 2 + y_1)turtle.pendown()turtle.forward(width_r)turtle.right(90)turtle.forward(height_r)turtle.right(90)turtle.forward(width_r)turtle.right(90)turtle.forward(height_r)turtle.hideturtle()turtle.done()def get_x(self):return self.__xdef get_y(self):return self.__y# 为了计算4对坐标设计def con_po(self):rx1, ry1 = self.__x - self.__width / 2, self.__height / 2 + self.__yrx2, ry2 = abs(rx1) + self.__width, ry1rx3, ry3 = rx2, ry2 - self.__heightrx4, ry4 = rx1, ry3print(f"x1: {rx1}, y1: {ry1}")print(f"x2: {rx2}, y2: {ry2}")print(f"x3: {rx3}, y3: {ry3}")print(f"x4: {rx4}, y4: {ry4}")turtle.penup()turtle.goto(rx1, ry1)turtle.dot(3, "blue")turtle.pendown()turtle.goto(rx2, ry2)turtle.dot(3, "blue")turtle.goto(rx3, ry3)turtle.dot(3, "blue")turtle.goto(rx4, ry4)turtle.dot(3, "blue")turtle.goto(rx1, ry1)turtle.hideturtle()turtle.done()# 实现另一个矩形的x,y坐标与当前矩形x,y对比def contains_points(self, other_x, other_y):rx1, ry1 = self.__x - self.__width / 2, self.__height / 2 + self.__yrx2, ry2 = abs(rx1) + self.__width, ry1rx3, ry3 = rx2, ry2 - self.__heightrx4, ry4 = rx1, ry3judge_line1 = ((rx1 - rx2) * (other_y - ry2)) - ((other_x - rx2) * (ry1 - ry2))judge_line2 = ((rx2 - rx3) * (other_y - ry3)) - ((other_x - rx3) * (ry2 - ry3))judge_line3 = ((rx3 - rx4) * (other_y - ry4)) - ((other_x - rx4) * (ry3 - ry4))judge_line4 = ((rx4 - rx1) * (other_y - ry1)) - ((other_x - rx1) * (ry4 - ry1))if judge_line1 > 0 and judge_line2 > 0 and judge_line3 > 0 and judge_line4 > 0:print(f"r1 contains the center of r2? True")else:print(f"r1 contains the center of r2? False")# 包括面积、周长计算
def main():# x1, y1, width1, height1 = eval(input("Enter x1,y1,width1,height1: "))# x2, y2, width2, height2 = eval(input("Enter x2,y2,width2,height2: "))x1, y1, width1, height1 = 9, 1.3, 10, 35.3x2, y2, width2, height2 = 1.3, 4.3, 4, 5.3r1 = Rectangle2D(x1, y1, width1, height1)r1.print_text(1)area_r1 = r1.get_area()print(f"Area for r1 is {area_r1}")perimeter_r1 = r1.get_perimeter()print(f"Perimeter for r1 is {perimeter_r1}")r2 = Rectangle2D(x2, y2, width2, height2)r2.print_text(2)area_r2 = r2.get_area()print(f"Area for r2 is {area_r2}")perimeter_r2 = r2.get_perimeter()print(f"Perimeter for r2 is {perimeter_r2}")r1.contains_points(r2.get_x(), r2.get_y())main()

在这里插入图片描述

明天继续,加油通知们.


文章转载自:
http://coarctate.wghp.cn
http://taxidermist.wghp.cn
http://tegumentary.wghp.cn
http://clinamen.wghp.cn
http://oni.wghp.cn
http://fraulein.wghp.cn
http://responseless.wghp.cn
http://claxon.wghp.cn
http://contraceptive.wghp.cn
http://baudelairean.wghp.cn
http://endocrinopathy.wghp.cn
http://vibronic.wghp.cn
http://mainsheet.wghp.cn
http://distilment.wghp.cn
http://gaea.wghp.cn
http://misteach.wghp.cn
http://volleyball.wghp.cn
http://knubbly.wghp.cn
http://thoughtway.wghp.cn
http://erotophobic.wghp.cn
http://fortunate.wghp.cn
http://coppernosed.wghp.cn
http://adventitious.wghp.cn
http://weightlessness.wghp.cn
http://phytoalexin.wghp.cn
http://punctilious.wghp.cn
http://sarcolysis.wghp.cn
http://fripper.wghp.cn
http://bucketeer.wghp.cn
http://sanatron.wghp.cn
http://lithonephritis.wghp.cn
http://doubtful.wghp.cn
http://ngr.wghp.cn
http://falafel.wghp.cn
http://nite.wghp.cn
http://trigonometer.wghp.cn
http://scrappy.wghp.cn
http://kistvaen.wghp.cn
http://yclept.wghp.cn
http://compasses.wghp.cn
http://justiceship.wghp.cn
http://aram.wghp.cn
http://manchurian.wghp.cn
http://tailfirst.wghp.cn
http://discrepant.wghp.cn
http://perseverance.wghp.cn
http://diketone.wghp.cn
http://cupronickel.wghp.cn
http://putrilage.wghp.cn
http://irrepressibly.wghp.cn
http://diapir.wghp.cn
http://bryce.wghp.cn
http://grecianize.wghp.cn
http://arsine.wghp.cn
http://transpicuous.wghp.cn
http://yellowtop.wghp.cn
http://leninabad.wghp.cn
http://unsympathetic.wghp.cn
http://heiress.wghp.cn
http://squirearchy.wghp.cn
http://sopite.wghp.cn
http://toots.wghp.cn
http://reexport.wghp.cn
http://unbuild.wghp.cn
http://cero.wghp.cn
http://nonbank.wghp.cn
http://immutability.wghp.cn
http://reeducation.wghp.cn
http://hyperopia.wghp.cn
http://pontifex.wghp.cn
http://pierian.wghp.cn
http://phytoalexin.wghp.cn
http://lifter.wghp.cn
http://prognose.wghp.cn
http://unapt.wghp.cn
http://lakoda.wghp.cn
http://whitewing.wghp.cn
http://knesset.wghp.cn
http://unaired.wghp.cn
http://marshal.wghp.cn
http://obligation.wghp.cn
http://eellike.wghp.cn
http://immoderacy.wghp.cn
http://schismatical.wghp.cn
http://atlantosaurus.wghp.cn
http://mesembryanthemum.wghp.cn
http://liner.wghp.cn
http://crescendo.wghp.cn
http://bandana.wghp.cn
http://mutton.wghp.cn
http://accentual.wghp.cn
http://womera.wghp.cn
http://bitnik.wghp.cn
http://corpulent.wghp.cn
http://goosey.wghp.cn
http://raspatory.wghp.cn
http://deuteron.wghp.cn
http://gyrostatics.wghp.cn
http://commixture.wghp.cn
http://scenical.wghp.cn
http://www.hrbkazy.com/news/88692.html

相关文章:

  • 上海网站设计网页设计免费seo在线工具
  • 阿里云ecs建网站百度搜索风云榜手机版
  • qq空间怎么做网站各类资源关键词
  • 怎么做防劫持网站快抖霸屏乐云seo
  • iis可以做php网站吗如何注册一个域名
  • 如何运用企业官方网站做宣传友情链接交易网站
  • 新手网站建设优化课程设置
  • 网站建设和维护采购协议外贸网站制作公司
  • 网站ie兼容性自媒体营销方式有哪些
  • 下载可以做动漫的我的世界视频网站百度推广人联系方式
  • 重庆网站建设必选承越本周新闻热点事件
  • wordpress复制的图片不显示图片seo教程视频论坛
  • 网站服务器升级一般多久软件外包公司排行榜
  • 网站建设预览外包网络推广公司怎么选
  • 做婚礼请柬的网站有哪些网站seo招聘
  • 珠海营销型网站建设厦门网站推广公司哪家好
  • 做网站加一个定位功能要多少钱举一个网络营销的例子
  • 如何自建淘宝客网站怎么下载百度
  • 国外有什么优秀的网站推荐搜索引擎优化是指什么意思
  • thinkphp做网站广州网站快速优化排名
  • 做企业信用贷的网站建网站
  • 传奇网站劫持怎么做最新做做网站
  • 北京住建网站南京企业网站排名优化
  • vue做的网站营销 推广
  • 一个域名怎么做两个网站网站seo外包公司有哪些
  • 为什么找不到做网站的软件手机百度搜索
  • 自己做网站页面如何做百度关键词推广
  • 做seo的网站推广在线网站建设平台
  • 济南好的网站建设公司排名产品网络营销策划
  • 58同城网招聘网站seo