当前位置: 首页>>代码示例>>Python>>正文


Python Point.y方法代码示例

本文整理汇总了Python中Point.Point.y方法的典型用法代码示例。如果您正苦于以下问题:Python Point.y方法的具体用法?Python Point.y怎么用?Python Point.y使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Point.Point的用法示例。


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

示例1: calcMotionEnergy

# 需要导入模块: from Point import Point [as 别名]
# 或者: from Point.Point import y [as 别名]
	def calcMotionEnergy(self):
		n = len(self.points)
		l = 3
		speed = []
		for i in range(0,n-l-1):
			a,b = self.points[i].getCoords()
			dx = dy = 0
			for j in range(l):
				index = i+j+1
				c,d = self.points[i+l+1].getCoords()

				dx = dx + c - a
				dy = dy + d - b

			dx = dx/l
			dy = dy/l

			d = Point(dx, dy)
			speed.append(d)

		n = len(speed)

		if n == 0:
			return 0
			
		e = Point(0, 0)
		mx = my = 0
		for i in range(0,n):
			a,b = speed[i].getCoords()
			mx = mx + a
			my = my + b

		mx = mx/n
		my = my/n

		for i in range(0,n):
			a,b = speed[i].getCoords()

			dx = mx - a
			dy = my - b

			dx2 = dx*dx
			dy2 = dy*dy

			e.x = e.x + dx2
			e.y = e.y + dy2

		print(str(n-1))
		e.x = e.x/(n-1)
		e.y = e.y/(n-1)

		return e.length()
开发者ID:datjwu,项目名称:CMC_Integration,代码行数:54,代码来源:TrackInfo.py

示例2: center

# 需要导入模块: from Point import Point [as 别名]
# 或者: from Point.Point import y [as 别名]
 def center(points):
 	center_point = Point(0,0,0)
 	for point in points:
 		center_point.x += point.x
 		center_point.y += point.y
 	center_point.x = center_point.x/float(len(points))
 	center_point.y = center_point.y/float(len(points))	
     return center_point
开发者ID:Flourad,项目名称:Users_Clustering,代码行数:10,代码来源:demo.py

示例3: position_at

# 需要导入模块: from Point import Point [as 别名]
# 或者: from Point.Point import y [as 别名]
	def position_at(self, time):
		dt = time - self.src_time

		if dt > 0.0 and self.total_time > 0.0:
			ratio = dt / self.total_time 
			p = Point()
			p.x = self.src.x + self.dx * ratio
			p.y = self.src.y + self.dy * ratio
			return p
		else:
			return self.src
开发者ID:cbguder,项目名称:mona,代码行数:13,代码来源:Node.py

示例4: Point

# 需要导入模块: from Point import Point [as 别名]
# 或者: from Point.Point import y [as 别名]
from subscriber.srv import *
from Point import Point
from velchange import *
import math
from numpy import matrix
import signal
import sys
# from roboclaw import *

start_time = 1

centerField = Point()
goal = Point()
#hardcoded if vision is untrustworthy
centerField.x = 423
centerField.y = 234
goal.x = 0
goal.y = 234
defensex = 50
globalCounter = 0
dbehind = 20
yNorthThreshold = -30
ySouthThreshold = 15
yNorthOffset = -16
ySouthOffset = 18
goalYOffset = -12
fastMaxSpeed = .9
slowMaxSpeed = .3
maxSpeed = fastMaxSpeed

FIELD_CENTERX = 304
开发者ID:hzobrist,项目名称:TheResistance,代码行数:33,代码来源:fieldListener.py


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