• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python art.line函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中tealight.art.line函数的典型用法代码示例。如果您正苦于以下问题:Python line函数的具体用法?Python line怎么用?Python line使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了line函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: linethree

def linethree(x1,y1,z1,x2,y2,z2):

  a1=x1*math.cos(phi)-y1*math.sin(phi)
  b1=x1*math.sin(phi)+y1*math.cos(phi)
  
  c1=b1*math.cos(theta)-z1*math.sin(theta)
  d1=b1*math.sin(theta)+z1*math.cos(theta)
  
  e1=screen_width/2+a1*math.cos(alpha)-c1*math.sin(alpha)
  f1=screen_height/2+a1*math.sin(alpha)+c1*math.cos(alpha)
  
  
  a2=x2*math.cos(phi)-y2*math.sin(phi)
  b2=x2*math.sin(phi)+y2*math.cos(phi)
  
  c2=b2*math.cos(theta)-z2*math.sin(theta)
  d2=b2*math.sin(theta)+z2*math.cos(theta)
  
  e2=screen_width/2+a2*math.cos(alpha)-c2*math.sin(alpha)
  f2=screen_height/2+a2*math.sin(alpha)+c2*math.cos(alpha)
  
#  a1=screen_width/2+x1*math.sqrt(3)/2-y1/2
#  b1=screen_height/2+x1/2+y1*math.sqrt(3)/2-z1
#  a2=screen_width/2+x2*math.sqrt(3)/2-y2/2
#  b2=screen_height/2+x2/2+y2*math.sqrt(3)/2-z2
  line(e1,f1,e2,f2)
开发者ID:jamesmunro123,项目名称:tealight-files,代码行数:26,代码来源:3d.py


示例2: handle_message

def handle_message(message):
  if message["type"] == "reset":
    initialPlayer2()
  
  if message["type"] == "line":    
    color(message["color"])
    line(message["x1"], message["y1"], message["x2"], message["y2"])
开发者ID:darkchaoticlord,项目名称:tealight-files,代码行数:7,代码来源:pictionaryPlayer2.py


示例3: handle_mousemove

def handle_mousemove(x,y,button):
  global lastx, lasty
  
  if button == "left":
    line(lastx, lasty, x, y)
    lastx = x
    lasty = y
开发者ID:Alex-Thornton,项目名称:tealight-files,代码行数:7,代码来源:sketch.py


示例4: handle_mousedown

def handle_mousedown(x,y):
  global lastx, lasty
  
  if button == "right":
    line(lastx, lasty, x, y)
    lastx = x
    lasty = y 
开发者ID:chandler6,项目名称:tealight-files,代码行数:7,代码来源:sketch.py


示例5: handle_mousemove

def handle_mousemove(x,y,button):
  global lastx, lasty
  
  if button == "left":
    line(lastx, lasty, x, y)
    send({"x1": lastx, "y1": lasty, "x2": x, "y2": y})
    lastx = x
    lasty = y
开发者ID:jmlowenthal,项目名称:tealight-files,代码行数:8,代码来源:shared_whiteboard.py


示例6: handle_mousemove

def handle_mousemove(x, y, button):
   global xpos, ypos
    
   if button == "left":
    line(xpos, ypos, x, y)
    send({"xpos":xpos, "ypos":ypos, "x":x,"y":y})
    xpos = x
    ypos = y
开发者ID:sagelin,项目名称:tealight-files,代码行数:8,代码来源:input.py


示例7: handle_mousemove

def handle_mousemove(x,y,button):
  global lastx, lasty, hue
  
  if button == "left":
    line(lastx, lasty, x, y)
    lastx = x
    lasty = y
    color("hsl(%d,100%%,50%%)" % hue)
    hue += 1
开发者ID:anthonyajsmith,项目名称:tealight-files,代码行数:9,代码来源:sketch.py


示例8: parallel

def parallel(x1,y1,x2,y2,x3,y3):
  x1=int(x1)
  y1=int(y1)
  x2=int(x2)
  y2=int(y2)
  x3=int(x3)
  y3=int(y3)
  for i in range(x1,x2):
    line(i,(y2-y1)*(i-x1)/(x2-x1)+y1,x3-x1+i,(y2-y1)*(i-x1)/(x2-x1)+y3)
开发者ID:jamesmunro123,项目名称:tealight-files,代码行数:9,代码来源:squares.py


示例9: handle_mousemove

def handle_mousemove(x,y):
  global lastx, lasty, hue
  
  line(lastx or x, lasty or y, x, y)
  color("hsl(%d,100%%,50%%)" % hue)
  
  hue += 1
  
  lastx = x
  lasty = y
开发者ID:a-l-williams,项目名称:tealight-files,代码行数:10,代码来源:art-demo.py


示例10: star

def star(x, y, c, w, h, spines):

    color(c)

    angle = 0

    for i in range(0, spines):
        x0 = x + (w * cos(angle))
        y0 = y + (h * sin(angle))
        line(x, y, x0, y0)
        angle = angle + (2 * pi / spines)
开发者ID:jmlowenthal,项目名称:tealight-files,代码行数:11,代码来源:stars.py


示例11: handle_mousemove

def handle_mousemove(x,y,button):
  global lastx, lasty
  
  if button == "left":
    line(lastx, lasty, x, y)
    lastx = x
    lasty = y
  elif button == "right":
    color("red")
    line(lastx, lasty, x, y)
    lastx = x
    lasty = y
开发者ID:iTomaaaHD,项目名称:tealight-files,代码行数:12,代码来源:sketch.py


示例12: star

 def star(self, x, y, c, size, spines):
   color(c)
   
   angle = 0
   
   for i in range(0, spines):
     x0 = x + (size * cos(angle))
     y0 = y + (size * sin(angle))
     
     line(x, y, x0, y0)
     
     angle = angle + (2 * pi / spines)
开发者ID:rexapex,项目名称:tealight-files,代码行数:12,代码来源:explosion.py


示例13: star

def star(x, y, c, rx, ry, spines):
  
  color(c)
  
  angle = 0
  
  for i in range(0, spines):
    x0 = x + (rx * cos(angle))
    y0 = y + (ry * sin(angle))
    
    line(x, y, x0, y0)
    
    angle = angle + (2 * pi / spines)
开发者ID:BasRegi,项目名称:tealight-files,代码行数:13,代码来源:stars.py


示例14: handle_mousemove

def handle_mousemove(x,y,button):
  global lastx, lasty
  
  if button == "left":
    color("red")
  elif button == "right":
    color("blue")
  else:
    return
  
  line(lastx, lasty, x, y)
  lastx = x
  lasty = y
开发者ID:jmlowenthal,项目名称:tealight-files,代码行数:13,代码来源:sketch.py


示例15: handle_mousemove

def handle_mousemove(x,y,button):
  global lastx, lasty
  
  if button == "left":
    color("blue")
    line(lastx, lasty, x, y)
    lastx = x
    lasty = y
  if button == "right":
    color("black")
    line(lastx, lasty, x, y)
    lastx = x
    lasty = y
开发者ID:NickMcAlpin,项目名称:tealight-files,代码行数:13,代码来源:sketch.py


示例16: ellipse

def ellipse(x, y, c, sizex, sizey, spines):
  
  color(c)
  
  angle = 0
  
  for i in range(0, spines):
    x0 = x + (sizex * cos(angle))
    y0 = y + (sizey * sin(angle))
    
    line(x, y, x0, y0)
    
    angle = angle + 1
开发者ID:mauriceyap,项目名称:tealight-files,代码行数:13,代码来源:stars.py


示例17: elipses

def elipses(x, y, c, size, size2):
  
  color(c)
  
  angle = 0
  
  for i in range(0,size2):
    x0 = x + (size * cos(angle))
    y0 = y + (size * sin(angle))
    
    line(x, y, x0, y0)
    
    angle = angle + (2 * pi / size2)
开发者ID:princz,项目名称:tealight-files,代码行数:13,代码来源:stars.py


示例18: ellipse

def ellipse(x, y, c, height, width):
  
  color(c)
  
  angle = 90
  
  for i in range(0, width):
    x0 = x + (height * cos(angle) * 2)
    y0 = y + (height * sin(angle))
    
    line(x, y, x0, y0)
    
    angle = angle + (2 * pi / width)
开发者ID:jackm110,项目名称:tealight-files,代码行数:13,代码来源:stars.py


示例19: star

def star(x, y, c, vertical, horizontal, spines):
  
  color(c)
  
  angle = 0
  
  for i in range(0, spines):
    x0 = x + (horizontal * cos(angle))
    y0 = y + (vertical * sin(angle))
    
    line(x, y, x0, y0)
    
    angle = angle + (2 * pi / spines)
开发者ID:davidsamueljones,项目名称:tealight-files,代码行数:13,代码来源:stars.py


示例20: star

def star(x, y, c, size, spines, xstretch, ystretch):
  
  color(c)
  
  angle = 0
  
  for i in range(0, spines):
    
    x0 = x + (size * cos(angle) * xstretch)
    y0 = y + (size * sin(angle) * ystretch)
    
    line(x, y, x0, y0)
    
    angle = angle + (2 * pi / spines)
开发者ID:c-ryan747,项目名称:tealight-files,代码行数:14,代码来源:stars.py



注:本文中的tealight.art.line函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python art.spot函数代码示例发布时间:2022-05-27
下一篇:
Python art.image函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap