顺时针&逆时针圆弧绘制算法 [英] clockwise & counter-clockwise arc drawing algorithm

查看:175
本文介绍了顺时针&逆时针圆弧绘制算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从3点绘制弧线(类似于CAD中的实时")-精确地(如何从光标处检查)弧线是顺时针还是逆时针

更新:

http://a.imageshack.us/img230/2429/arcs.gif

我知道如何绘制这样的弧形,但是我不知道如何找到鼠标何时跨过点之间的线段以及何时必须更改方向:-O

我尝试使用本文中的解决方案 OpenS-CAD,一个简单的2D CAD应用程序 [ ^ ],但无法正常工作

how to draw arc ("real-time" like in CAD) from 3 points - precisely, how check (from cursor)it arc will be clockwise or counter-clockwise

UPDATE:

http://a.imageshack.us/img230/2429/arcs.gif

i know how to draw arc like this, but i dont know how to find when mouse cross the segment between points and when i must change direction :-O

i try use soluction from this article OpenS-CAD, a simple 2D CAD application[^]but it not work proertly

推荐答案

您是否在问一些数学计算两个矢量之间的夹角以检查圆弧?您提到了3点,我想是这样的:

[
Do you asking about some math to calculate angle between 2 vectors to check the arc? You mentioned about 3 points and i asume there is something like this:

[how do i see this]

then you need to calculate angle or check dot product between 2 vectors and according to result you will be able to say if the arc is clockwise or counter-clockwise.

I''m not sure if this is such low level problem but if you need any other help with math-drawing feel free to ask. Stuff like this is kind of my hobby ;)


您确定点的相对位置是顺时针还是逆时针吗?
you work out if it''s clockwise or counterclockwise from the relative position of the points, surely ?


这篇关于顺时针&逆时针圆弧绘制算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆