我想有一个直接的C#函数来获得最近点(从点P)到线段AB.抽象函数可能如下所示.我搜索了SO,但没有找到可用的(由我)解决方案.
public Point getClosestPointFromLine(Point A, Point B, Point P);
Run Code Online (Sandbox Code Playgroud) 我正在寻找任何(相关的?)开源项目,它在服务器端呈现网页并作为图像传递给客户端(手机?).就像Opera Mini和SkyFire一样.到目前为止,谷歌并没有给我一个线索,因为我无法弄清楚使用哪个术语.你们能给我一个线索吗?
谢谢
我想画一条厚度为j2me的线.通过将Pen width设置为厚度值,可以在桌面java中轻松实现.但是在j2me中,Pen类不支持宽度.我的想法是从我拥有的线生成一个多边形,类似于我想要绘制的厚度线.在图片中,左边是我所拥有的,带有点的线.在右边是我想要的,一个多边形,当填充时,一条线有厚度.谁能知道如何从线生成多边形?
alt text http://www.freeimagehosting.net/uploads/140e43c2d2.gif
我想知道如何从水平轴X获得AB线的角度.SO中的其他问题仅在两条线之间进行.我知道我总是可以绘制第二行AC并计算,但我想知道是否有更快的方法.
编辑:我很确定我没有做过早优化.
自Apple发布iTunes for Windows以来,我很想知道它.他们用什么来为Windows编写iTunes?它似乎完全有自己的UI组件,一切都包含在其中.它甚至使用QuickTime资源文件.我们可以假设他们的Cocoa与Windows一起工作.无论如何,我的主要问题是,是否有任何已知的(公共或私人)工具/语言/框架用于开发iTunes for Windows?
我已经实现了 A* 算法根据维基百科的实现在这里 然而,在移动设备上运行太慢了。尽管它在台式计算机上运行良好,但我必须等待无数个小时才能完成该功能。我可以做些什么来优化算法?
这是实际的代码
public DriveRoute findroute(routenode from, routenode to)
{
Dictionary<int, routenode> openlist = new Dictionary<int, routenode>();
openlist.Add(from.nodeid, from);
Dictionary<int, routenode> closedlist = new Dictionary<int, routenode>();
Dictionary<int, double> gscores = new Dictionary<int, double>();
gscores.Add(from.nodeid, 0);
Dictionary<int, double> hscores = new Dictionary<int, double>();
hscores.Add(from.nodeid, distanceForRouting(from.latlon, to.latlon));
Dictionary<int, double> fscores = new Dictionary<int, double>();
fscores.Add(from.nodeid, gscores[from.nodeid] + hscores[from.nodeid]);
Dictionary<int, routenode> came_from = new Dictionary<int, routenode>();
while (openlist.Values.Count > 0)
{
routenode x = getLowestFscore(openlist, fscores);
if (x.latlon.Equals(to.latlon))
{
return …Run Code Online (Sandbox Code Playgroud) 我想使用.NET CF显示GPS设备的信号栏.我能够读取NMEA数据并获得SNR信号.但它们是一些卫星,其中一些有效,一些无效,具有各种SNR.我想要获得总SNR的平均值,但它不能给出准确的值,因为三个强信号卫星足以用于GPS定位,而另外5个具有差SNR的卫星可能会使信号条计算混乱.我如何以适当的方式以百分比计算GPS信号?
我有一个三个lat-lon坐标组成两个线段A到B到C.我还发现了一个函数,它可以以-180到180的方式返回线段AB或BC的北轴承.但是,我很难确定汽车何时从A到B,如果它向右或向左转到继续到C.
如何以编程方式从C#更改Fat32分区的卷序列.我找到了这个例子,但它是用C++编写的,我读得不好.有人可以回答一个C#代码片段吗?
更新:我可以看到上面例子中的C++函数,我认为可以将端口指向C#
void CVolumeSerialDlg::ChangeSerialNumber(DWORD Drive, const DWORD newSerial)
{
const max_pbsi = 3;
struct partial_boot_sector_info
{
LPSTR Fs; // file system name
DWORD FsOffs; // offset of file system name in the boot sector
DWORD SerialOffs; // offset of the serialnumber in the boot sector
};
partial_boot_sector_info pbsi[max_pbsi] =
{
{"FAT32", 0x52, 0x43},
{"FAT", 0x36, 0x27},
{"NTFS", 0x03, 0x48}
};
TCHAR szDrive[12];
char Sector[512];
DWORD i;
sprintf(szDrive, "%c:\\", Drive & 0xFF);
if (!disk.Open(szDrive))
{
ShowErrorString("Could not open disk!"); …Run Code Online (Sandbox Code Playgroud)