Add 'Angle of Vector' user function

Issue #317 new
Susan Spencer created an issue

Create a function angleOfVector(A, B, C) to return the angle in degrees between A & C, with B as the center point of the vector. The angle returned is always positive and is 180 degrees or less ( 0 <= angle <= 180)

Users can include this function in their formulas wherever an angle is required, e.g. to create a point at distance and angle, or to create a control handle for a curve.

Comments (5)

  1. Roman Telezhynskyi repo owner

    One thing I noticed from the XML schema was the regex being used for the names of drawing objects. It appears that an underscore ‘_’ is valid as part of a name. This would seem to conflict with the requirement to parse line length references within formula. E.g.

    I create some points with names: ‘A’, ‘A_B’, ‘B’, ‘B_C’ and ‘C’. I then draw a line between ‘A_B’ and ‘C’ This gives a line reference that I can use in formula ‘Line_A_B_C’ I then create a second line between ‘A’ and ‘B_C’. This also has a line reference that I can use in formula 'Line_A_B_C’ This is therefore ambiguous.

    The easiest fix would be to disallow underscore from object names. In fact, the problem is even easier to reproduce if I label a point ‘Line_A_B’, though I am less likely to do that by accident. This doesn’t cause a failure, Valentina just silently uses the first value that provides that name, however this could be very confusing, especially if the values were similar.

  2. Log in to comment