Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

Re: [Phys-L] dot minus



On 2/3/19 9:33 AM, Jeffrey Schnick asked:

Any thoughts on the dot minus operator?

I'm OK with any of the following (among others):

5kg ⋅ −3m/s dot product
5kg × −3m/s cross product
5kg ∧ −3m/s wedge product
5kg * −3m/s
5kg (−3m/s) apposition product

Rationale: We are not talking about a "dot minus" operator,
but rather two separate operators. Putting a space between
the two operators is helpful but not formally necessary.

In this context, the "dot minus" syntax is unambiguous.
Starting from
5kg ⋅ −3m/s
you could not possibly parse it as
(5kg ⋅) −3m/s
because "⋅" is a binary operator. Therefore your only choice
is to parse it as
5kg ⋅ (−3m/s)

In another context "−" might be a binary operator (i.e.
subtraction) but in this context it is unambiguously unary
(i.e. negation).

And of course you can stick additional optional parentheses
into any of the above.

IN CONTRAST: Without the parentheses, the apposition product
would not work, because the "−" would be interpreted as a
binary operator:
5kg −3m/s subtraction
or similarly
5cm −3cm subtraction

I mention the latter to make the point that you can't always
rely on dimensional analysis to catch mistakes.

For an operator that could be binary or unary, in cases where
it's actually binary, if there's a space before it it helps
to put a space after it:
5cm − 3cm subtraction (prettier)
but this is not formally necessary; you shouldn't have to
rely on the spacing to parse such operators.

Bottom line: The apposition product does not play nicely
with "−" and other operators that might be unary or binary.
In contrast, there is no problem with the explicit multiplication
operators (e.g. dot, cross, wedge, star, et cetera).