In Python NumPy what is a dimension and axis?

前端 未结 6 2214
终归单人心
终归单人心 2020-12-04 05:29

I am coding with Pythons NumPy module. If coordinates of a point in 3D space are described as [1, 2, 1], wouldn\'t that be three dimensions, three

6条回答
  •  悲哀的现实
    2020-12-04 06:06

    This is how I understand it. A point is a 1D object. You can only define its position. It has no dimensions. A line or surface is a 2D object. You can define it by both its position and length or area respectively e.g. Rectangle, Square, Circle A volume is a 3D object. You can define it by its position, surface area/lengths and volume e.g. Sphere, Cube.

    From this, you will define a point in NumPy by a single axis (dimension), regardless of the number of mathematical axes you use. For x and y axes, a point is defined as [2,4], and for x, y and z axes, a point is defined as [2,4,6]. Both of these are points, thus 1D.

    To define a line, two points will be needed. This will require some form of 'nesting' of the points to the second dimension (2D). As such, a line may be defined using x and y only as [[2,4],[6,9]] or using x, y and z as [[2,4,6],[6,9,12]]. For a surface, it will simply require more points to describe it, but still remains a 2D object. For example, a triangle will need 3 points while a rectangle/square will need 4.

    A volume will require 4 (a tetrahedron)or more points to define it , but still maintaining the 'nesting' of points to the third dimension (3D).

提交回复
热议问题