patternmath.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:TauMeta 作者: slspencer 项目源码 文件源码
def intersectChordCircle(C, P, chord_length):
    ''' 
    Accepts center of circle, a point on the circle, and chord length.  
    Returns a list of two points on the circle at chord_length distance away from original point
    '''
    C = dPnt(C)
    P = dPnt(P)
    d = chord_length
    r = distance(C, P)
    # point on circle given chordlength & starting point=2*asin(d/2r)
    d_div_2r = d / (2.0 * r)
    angle = 2 * asin(d_div_2r)
    P = []
    P.append(polar(C, r, angle))
    P.append(polar(C, r, - angle))
    return P

#def tangentOnCircleFromPoint(C, r, P):
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号