离非共面点最近的飞机?(Nearest plane to non-coplanar points?)
我有许多非共面3D点,我想计算它们最近的平面(它们总是形成一个粗糙的平面,但有一些小的变化)。 这可以通过求解形式的每个点一个的联立线性方程来完成:
“Ax + By + Cz + D = 0”
我现在遇到的问题是双重的。
首先,因为点是3D浮点数,所以由于舍入误差,它们不能被精确地依赖。
其次,迄今为止我发现的所有以编程方式求解线性方程的方法都涉及使用NXN矩阵,这严重限制了我能够做的事情,因为我有4个未知数和任意数量的线性方程(由于数量的变化3D点数)。
有没有人有一个不错的方法来解决没有这些约束的联立线性方程,或者,更好的方法来计算最近的平面到非共面点? (平面计算的精度不是太大关注)
谢谢! :)
I have a number of non-coplanar 3D points and I want to calculate the nearest plane to them (They will always form a rough plane but with some small level of variation). This can be done by solving simultaneous linear equations, one for each point, of the form:
"Ax + By + Cz + D = 0"
The problem I'm having at the moment is twofold.
Firstly since the points are 3D floats they can't be relied on to be precise due to rounding errors.
Secondly all of the methods to solving linear equations programatically that I have found thus far involve using NXN matrices which severely limits what I would be able to do given that I have 4 unknowns and any number of linear equations (due to the variation in the number of 3D points).
Does anyone have a decent way to either solve the simultaneous linear equations without these constraints or, alternatively, a better way to calculate the nearest plane to non-coplanar points? (The precision of the plane calculation is not too much of a concern)
Thanks! :)
原文:https://stackoverflow.com/questions/22743694
最满意答案
将子端更改为使用ObjectID引用所有者并创建自定义瞬态getter getOwner(),该getOwner()基于owner_id获取所有者。 在grails中很容易做到,应该便于在c#中进行序列化。
Change child side to using an ObjectID ref to owner and make a custom transient getter getOwner() that fetches the owner based on the owner_id. Very easy to do in grails, should facilitate easy serialization in c#.
相关问答
更多-
是的,您不能忘记添加BsonId属性,因为每个对象都必须拥有自己唯一的ID。 public class Model1 { [BsonId] public int ID { get; set; } public string Title { get; set; } public DateTime ReleaseDate { get; set; } public string Genre { get; set; } public decimal Price { g ...
-
是的,他们都会。 GC遍历依赖关系树,并且看到程序的任何其他部分都无法访问它们并且将正确地处理它们。 这是一篇很好的MSFT文章: http : //msdn.microsoft.com/en-us/magazine/bb985010.aspx Yes, they both will. The GC walks the dependency tree and sees that neither of them are reachable by any other part of the program an ...
-
我不认为这是可能的。 我将在MongoDB中实现另一个Document,其中插入了所有更改。 您的第二个程序可以检查文档中的新更改。 比你有一个强大的拉动系统。 也许您可以将文档称为Notification或ChangeLog 。 (没有ReplicaSet的解决方案) Its possible using the Tail-able Cursor in MongoDB. Create the MongoDB service as a replica service.Create only primary ...
-
我尝试使用官方mongodb c#驱动程序的最新版本重新创建您的问题,但我不能。 我正在使用NuGet上最新的官方驱动程序: 我更改了您的代码以使用非过时的方法来获取服务器对象: public MongoMovieHelper() { var client = new MongoClient(MongoUrl.Create("mongodb://localhost:27017")); var server = client.GetServer(); v ...
-
感谢来自Enthought邮件列表的Adam Hughes和Warren Weckesser,我意识到我的理解中缺少了什么。 属性并不真正作为属性存在。 我现在将它们视为类似“虚拟”属性的东西,它完全取决于类的编写者在调用_getter或_setter时所做的事情。 因此,当我希望能够通过用户设置波长和频率时,我只需要了解频率本身不作为属性存在,而是在设置频率的时间我需要更新“基本”属性波长,以便下次需要频率时,再次使用新波长计算! 我还要感谢用户sr2222,他让我想到了丢失的缓存。 我意识到,只有在使用 ...
-
大多数功能应该由驱动程序在C#级别提供。 但是,如果你想要做一些更高级的查询,比如map-reduce,你就会有点编写一些Javascript - 就像为RDBMS编写SQL一样。 Most of the functionality should be made available at the C# level by the driver. If, however, you want to do some more advanced queries, like a map-reduce, you're s ...
-
将子端更改为使用ObjectID引用所有者并创建自定义瞬态getter getOwner(),该getOwner()基于owner_id获取所有者。 在grails中很容易做到,应该便于在c#中进行序列化。 Change child side to using an ObjectID ref to owner and make a custom transient getter getOwner() that fetches the owner based on the owner_id. Very eas ...
-
MongoDb C#驱动程序(MongoDb C# driver)[2022-09-23]
1)您可以使用唯一索引: http : //docs.mongodb.org/manual/core/indexes/#unique-indexes var index = new IndexKeysBuilder(); index.Ascending(c => c.Symbol); Collection.EnsureIndex(index, new IndexOptionsBuilder().SetUnique(true)); 2)你有2个选择 从数据库中读取公司对象,添加 ... -
解决循环引用(C#)(Resolving Circular References (C#))[2023-06-18]
为所有非平凡的类使用接口。 将接口放在与实现不同的程序集中。 Use interfaces for all non-trivial classes. Place interfaces in a different assembly from implementation.