Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
可以设计一个量纲的类,里面包含一个整形数组来记录量纲的分量,如[L, M, T]还要定义量纲的运算。然后设计一个标量的类,里面除了浮点数据之外,再加一个量纲,定义标量的动作时也要注意其中的量纲计算。同理还可以定义向量和张量。比如距离的量纲是[1, 0, 0],速度的量纲是[1, 0, -1]。