oaVector
模块: oapy._oa._base
导入: from oapy._oa import _base
概览
oaVector 在 oapy 中可用,可通过 _base 模块访问。
本页汇总 oaVector 当前在 oapy 中可用的 Python 接口。
详细说明
The oaVector class implements a two-dimensional vector。
构造函数
_base.oaVector()
obj = _base.oaVector()
_base.oaVector(xValIn, yValIn)
obj = _base.oaVector(xValIn, yValIn)
_base.oaVector(head)
obj = _base.oaVector(head)
_base.oaVector(tail, head)
obj = _base.oaVector(tail, head)
方法总览
| 状态 | Python 调用 |
|---|---|
| ✅ | obj.x() |
| ✅ | obj.y() |
| ✅ | obj.x() |
| ✅ | obj.y() |
| ✅ | obj.set(tail, head) |
| ✅ | obj.setLength(length) |
| ✅ | obj.getLength() |
| ✅ | obj.leftOf(ref) |
| ✅ | obj.rightOf(ref) |
| ✅ | obj.rotate90() |
| ✅ | obj.rotate180() |
| ✅ | obj.rotate270() |
| ✅ | obj.addToPoint(start, result) |
| ✅ | obj.subFromPoint(start, result) |
| ✅ | obj.intersects(ref, other, otherRef, iPt) |
| ✅ | obj.operator==(v) |
| ✅ | obj.operator!=(v) |
| ✅ | obj.normalize() |
| ✅ | obj.getCosAngle(v) |
方法说明
obj.x()
绑定状态: 已绑定
Python 调用: obj.x()
This function returns the X value of this vector。
Python 示例
from oapy._oa import _base
# assume obj is a oaVector
obj.x()
obj.y()
绑定状态: 已绑定
Python 调用: obj.y()
This function returns the Y value of this vector。
Python 示例
from oapy._oa import _base
# assume obj is a oaVector
obj.y()
obj.x()
绑定状态: 已绑定
Python 调用: obj.x()
This function returns the X value of this vector。
Python 示例
from oapy._oa import _base
# assume obj is a oaVector
obj.x()
obj.y()
绑定状态: 已绑定
Python 调用: obj.y()
This function returns the Y value of this vector。 friend class oaChecker < oaVector > [friend]。
Python 示例
from oapy._oa import _base
# assume obj is a oaVector
obj.y()
obj.set(tail, head)
绑定状态: 已绑定
Python 调用: obj.set(tail, head)
This function recreates this vector based upon the segment generated from the head point to the tail point。
参数
head: The head point of the new vector。tail: The tail point of the new vector。
Python 示例
from oapy._oa import _base
# assume obj is a oaVector
obj.set(tail, head)
obj.setLength(length)
绑定状态: 已绑定
Python 调用: obj.setLength(length)
This function sets the length of this vector to the specified value。 The result is undefined for a zero length vector。
参数
length: The length of the new vector。
Python 示例
from oapy._oa import _base
# assume obj is a oaVector
obj.setLength(length)
obj.getLength()
绑定状态: 已绑定
Python 调用: obj.getLength()
This function returns the length of this vector。
Python 示例
from oapy._oa import _base
# assume obj is a oaVector
obj.getLength()
obj.leftOf(ref)
绑定状态: 已绑定
Python 调用: obj.leftOf(ref)
This function returns true if this vector is to the left of the specified vector。 "Leftof" means the angle of this vector minus the angle of ref is between 0 and 180 degrees。
参数
ref: The specified vector。
Python 示例
from oapy._oa import _base
# assume obj is a oaVector
obj.leftOf(ref)
obj.rightOf(ref)
绑定状态: 已绑定
Python 调用: obj.rightOf(ref)
This function returns true if this vector is to the right of the specified vector。 "Rightof" means the angle of this vector minus the angle of ref is between 180 and 360 degrees。
参数
ref: The specified vector。
Python 示例
from oapy._oa import _base
# assume obj is a oaVector
obj.rightOf(ref)
obj.rotate90()
绑定状态: 已绑定
Python 调用: obj.rotate90()
This function rotates this vector by 90 degrees in a clockwise direction。
Python 示例
from oapy._oa import _base
# assume obj is a oaVector
obj.rotate90()
obj.rotate180()
绑定状态: 已绑定
Python 调用: obj.rotate180()
This function rotates this vector by 180 degrees in a clockwise direction。
Python 示例
from oapy._oa import _base
# assume obj is a oaVector
obj.rotate180()
obj.rotate270()
绑定状态: 已绑定
Python 调用: obj.rotate270()
This function rotates this vector by 270 degrees in a clockwise direction。
Python 示例
from oapy._oa import _base
# assume obj is a oaVector
obj.rotate270()
obj.addToPoint(start, result)
绑定状态: 已绑定
Python 调用: obj.addToPoint(start, result)
This function adds this vector to the point start, and places the result in result。
参数
start: The starting point。result: The resulting point after this vector is added to start。
Python 示例
from oapy._oa import _base
# assume obj is a oaVector
obj.addToPoint(start, result)
obj.subFromPoint(start, result)
绑定状态: 已绑定
Python 调用: obj.subFromPoint(start, result)
This function subtracts this vector from the point start and places the result in result。
Python 示例
from oapy._oa import _base
# assume obj is a oaVector
obj.subFromPoint(start, result)
obj.intersects(ref, other, otherRef, iPt)
绑定状态: 已绑定
Python 调用: obj.intersects(ref, other, otherRef, iPt)
This function finds the point of intersection between this vector and vector other。 This function converts the vectors into segments。 The segments do all the work。
参数
ref: The head of this vector。other: The vector that intersects the reference vector。otherRef: The head of vector other。iPt: The point of intersection between the vectors。
Python 示例
from oapy._oa import _base
# assume obj is a oaVector
obj.intersects(ref, other, otherRef, iPt)
obj.operator==(v)
绑定状态: 已绑定
Python 调用: obj.operator==(v)
Python 示例
from oapy._oa import _base
# assume obj is a oaVector
obj.operator==(v)
obj.operator!=(v)
绑定状态: 已绑定
Python 调用: obj.operator!=(v)
Python 示例
from oapy._oa import _base
# assume obj is a oaVector
obj.operator!=(v)
obj.normalize()
绑定状态: 已绑定
Python 调用: obj.normalize()
This function normalizes this vector to a unit vector。 The result is undefined for a zero length vector。
Python 示例
from oapy._oa import _base
# assume obj is a oaVector
obj.normalize()
obj.getCosAngle(v)
绑定状态: 已绑定
Python 调用: obj.getCosAngle(v)
This function returns the cosine of the angle between this vector and the specified vector。
参数
v: The other vector to be used for angle measurement。
Python 示例
from oapy._oa import _base
# assume obj is a oaVector
obj.getCosAngle(v)