思享者

知其然亦知其所以然,以至不惑也

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年11月10日

摘要: 最近在项目中需要判断点和四边形关系,我的算法中涉及到了求解线段夹角的问题,于是编写了如下代码。问题描述平面坐标系中,已知三点坐标,求出任意两点组成的线段之间的夹角。使用向量夹角公式cos<夹角> = 两向量之积 / 两向量模的乘积<夹角> = arccos( 两向量之积 / 两向量模的乘积 ) 1 #include <cmath> 2 using std::acos; // 反余弦函数 3 using std::sqrt; // 平方根函数 4 //------------------------------------------------------- 阅读全文
posted @ 2011-11-10 14:10 LuckyLuke 阅读(21818) 评论(2) 推荐(1) 编辑

摘要: 1 using Word = Microsoft.Office.Interop.Word; 2 3 // 创建Word文档 4 Word.Application WordApp = null; 5 Word.Document WordDoc = null; 6 7 Object Nothing = System.Reflection.Missing.Value; 8 WordApp = new Word.ApplicationClass(); 9 WordDoc = WordApp.Documents.Add(ref Nothing, ref Nothing, ref Nothing,... 阅读全文
posted @ 2011-11-10 13:45 LuckyLuke 阅读(1036) 评论(0) 推荐(0) 编辑