Gnats 6066: Place in Other Views, relative to TWO existing objects, Similar Triangle [1] Bug Number: 6066 Release notes (y/n): no For Release Nums: 7.3 I have this coded, but the geometry calculations aren't quite right. The overall algorithm is as follows, implemented in this new method: okstat SimWorkspace::assignPosForAllViews_proximateNeighbors ( SimObj* newObj, int newObjX, int newObjY, CanvasDefs::CanvasGeometry geom); (1) If there are no other existing objects, the object is placed in the other views using the "proportional position with respect to scene rectangle" algorithm (i.e. what was implemented on Wednesday). (2) If the new object is EXACTLY ON another object in the source view, it is placed on that object in the other views. (3) If there is EXACTLY ONE other object, the new object is placed in the other views by scaling the vector from that object to the new object, based on the view sizes. This is implemented in the following function, and this IS working correctly: okstat SimWorkspace::assignPosForAllViews_projectFromRefObj ( SimObj* newObj, int newObjX, int newObjY, const SimObj* refObj, CanvasDefs::CanvasGeometry geom); (4) If there is more than one already existing object, two reference objects are identified: (1) the closest object, and (2) another object, preferring one that is also close to the new object coordinates. After having constructed a list of other objects sorted by distance from the new coordinates, we look for one that is closer to the new object than the to "closest object". If one is not found, we use the one whose distance ratio (distance to new object divided distance to closest object) is smallest. This IS working well. With those two proximate other objects, we call this method for each of the three workspace views. (This is not yet working well, geometry arithmetic problems, IN PROGRESS): okstat SimWorkspace::assignPosForAllViews_triangulateFromTwoRefObjs ( SimObj* newObj, int newObjX, int newObjY, const SimObj* refObj1, const SimObj* refObj2, CanvasDefs::CanvasGeometry sourceGeom, CanvasDefs::CanvasGeometry targGeom); (a) If the source geometry and target geometry are the same, the object is just assigned the given coordinates. If they are different, we do a sequence of calculations to produce a "SIMILAR TRIANGLE" in the target geometry, solving for the the new point in the target geometry. We calculate the distance between the two reference points in the two geometries, calculating a scaling factor which we apply to the distances between each of the reference points and the new coordinates in the source geometry. We then apply that scaling factor to compute those distances in the target geometry. With all three distances and the two existing SimObj positions in the target geometry, we should be able to compute the third point. I've attempted to implement the computations described on this webpage, but this is not coming up with correct values: "Determine third point of triangle when two points and all sides are known". https://math.stackexchange.com/questions/543961/ We need to correct the implementation in this assignPosForAllViews_triangulateFromTwoRefObjs() method. This is checked in to another new temporary branch: Bug6066b.