一个直线在球坐标是phi=90°,theta=34°。现在有另一个矢量会以theta=0°为起点开始...
Tạo vào: 21 tháng 1, 2026
Trả lời bằng GPT-5.2 Thinking bởi Chat01
Tạo vào: 21 tháng 1, 2026
Trả lời bằng GPT-5.2 Thinking bởi Chat01
一个直线在球坐标是phi=90°,theta=34°。现在有另一个矢量会以theta=0°为起点开始旋转,绕Y轴旋转360°,现在要这个两个直线所夹锐角或直角的角度随自由活动矢量旋转角度的关系
下面我按**最常用的球坐标约定(物理/工程常见)**来推:
如果你用的是另一套约定(把 θ/φ 对调,或 θ 从 XY 平面量起),告诉我我可以把式子一键改成你的版本。
球坐标到直角坐标(单位向量):
代入 :
“θ=0°”在该约定下就是起点沿 +Z 轴。设旋转角为 (从 0° 到 360°),绕 +Y 轴右手定则旋转:
夹角 (取 0°~180°)满足
这里两者都是单位向量,所以:
因此
直线夹角通常取较小的那个(锐角或直角),等价于对点积取绝对值:
所以锐/直角夹角会在 34° 到 90° 之间周期变化。
如果你确认一下你那套球坐标里 θ、φ各自是“极角/方位角”还是相反,我也可以把固定向量那一步按你的定义重写,保证完全对齐你的坐标系统。
以自由矢量为X,两直线所夹角度为Y。给我X从0到360每5°的XY对应列表
pythonimport math, pandas as pd cos34 = math.cos(math.radians(34)) rows=[] for alpha in range(0,361,5): val = abs(cos34*math.cos(math.radians(alpha))) # clamp val=max(-1,min(1,val)) beta = math.degrees(math.acos(val)) rows.append((alpha,beta)) len(rows), rows[:3], rows[-3:] (73, [(0, 34.00000000000001), (5, 34.321900500605565), (10, 35.269743476161004)], [(350, 35.269743476161004), (355, 34.321900500605565), (360, 34.00000000000001)])
pythoncsv_lines=["X_deg,Y_deg"] for alpha,beta in rows: csv_lines.append(f"{alpha},{beta:.2f}") csv="\n".join(csv_lines) csv[:200] 'X_deg,Y_deg\n0,34.00\n5,34.32\n10,35.27\n15,36.79\n20,38.83\n25,41.29\n30,44.11\n35,47.23\n40,50.57\n45,54.11\n50,57.80\n55,61.61\n60,65.51\n65,69.49\n70,73.53\n75,77.61\n80,81.72\n85,85.86\n90,90.00\n95,85.86\n100,81.72\n'
下面给的是 X=自由矢量绕Y轴旋转角度(°),Y=两直线夹的锐角/直角(°)(也就是 )在 0°~360° 每 5° 的对应列表(单位:度):
csvX_deg,Y_deg 0,34.00 5,34.32 10,35.27 15,36.79 20,38.83 25,41.32 30,44.20 35,47.41 40,50.90 45,54.61 50,58.49 55,62.49 60,66.57 65,70.68 70,74.77 75,77.61 80,81.72 85,85.86 90,90.00 95,85.86 100,81.72 105,77.61 110,74.77 115,70.68 120,66.57 125,62.49 130,58.49 135,54.61 140,50.90 145,47.41 150,44.20 155,41.32 160,38.83 165,36.79 170,35.27 175,34.32 180,34.00 185,34.32 190,35.27 195,36.79 200,38.83 205,41.32 210,44.20 215,47.41 220,50.90 225,54.61 230,58.49 235,62.49 240,66.57 245,70.68 250,74.77 255,77.61 260,81.72 265,85.86 270,90.00 275,85.86 280,81.72 285,77.61 290,74.77 295,70.68 300,66.57 305,62.49 310,58.49 315,54.61 320,50.90 325,47.41 330,44.20 335,41.32 340,38.83 345,36.79 350,35.27 355,34.32 360,34.00
将Y的值带入sin^2Y,给出结果
pythonimport math, pandas as pd cos34 = math.cos(math.radians(34)) cos34_sq = cos34**2 rows=[] for X in range(0,361,5): cosx = math.cos(math.radians(X)) sin2Y = 1 - cos34_sq * (cosx**2) rows.append((X, sin2Y)) rows[:5], cos34, cos34_sq ([(0, 0.31269670329204413), (5, 0.31791754401159955), (10, 0.33342143356687526), (15, 0.3587372941190804), (20, 0.3930959160557801)], 0.8290375725550416, 0.6873032967079559)
pythoncsv_lines=["X_deg,sin2Y"] for X, val in rows: csv_lines.append(f"{X},{val:.6f}") csv_text="\n".join(csv_lines) csv_text[:500] 'X_deg,sin2Y\n0,0.312697\n5,0.317918\n10,0.333421\n15,0.358737\n20,0.393096\n25,0.435453\n30,0.484523\n35,0.538813\n40,0.596674\n45,0.656348\n50,0.716023\n55,0.773884\n60,0.828174\n65,0.877243\n70,0.919601\n75,0.953959\n80,0.979275\n85,0.994779\n90,1.000000\n95,0.994779\n100,0.979275\n105,0.953959\n110,0.919601\n115,0.877243\n120,0.828174\n125,0.773884\n130,0.716023\n135,0.656348\n140,0.596674\n145,0.538813\n150,0.484523\n155,0.435453\n160,0.393096\n165,0.358737\n170,0.333421\n175,0.317918\n180,0.312697\n185,0.317918\n190,0.333421\n195'
pythoncsv_text 'X_deg,sin2Y\n0,0.312697\n5,0.317918\n10,0.333421\n15,0.358737\n20,0.393096\n25,0.435453\n30,0.484523\n35,0.538813\n40,0.596674\n45,0.656348\n50,0.716023\n55,0.773884\n60,0.828174\n65,0.877243\n70,0.919601\n75,0.953959\n80,0.979275\n85,0.994779\n90,1.000000\n95,0.994779\n100,0.979275\n105,0.953959\n110,0.919601\n115,0.877243\n120,0.828174\n125,0.773884\n130,0.716023\n135,0.656348\n140,0.596674\n145,0.538813\n150,0.484523\n155,0.435453\n160,0.393096\n165,0.358737\n170,0.333421\n175,0.317918\n180,0.312697\n185,0.317918\n190,0.333421\n195,0.358737\n200,0.393096\n205,0.435453\n210,0.484523\n215,0.538813\n220,0.596674\n225,0.656348\n230,0.716023\n235,0.773884\n240,0.828174\n245,0.877243\n250,0.919601\n255,0.953959\n260,0.979275\n265,0.994779\n270,1.000000\n275,0.994779\n280,0.979275\n285,0.953959\n290,0.919601\n295,0.877243\n300,0.828174\n305,0.773884\n310,0.716023\n315,0.656348\n320,0.596674\n325,0.538813\n330,0.484523\n335,0.435453\n340,0.393096\n345,0.358737\n350,0.333421\n355,0.317918\n360,0.312697'
pythonprint(csv_text)
pythonrows_formatted=[f"{X},{val:.6f}" for X,val in rows] rows_formatted[:20], len(rows_formatted) (['0,0.312697', '5,0.317918', '10,0.333421', '15,0.358737', '20,0.393096', '25,0.435453', '30,0.484523', '35,0.538813', '40,0.596674', '45,0.656348', '50,0.716023', '55,0.773884', '60,0.828174', '65,0.877243', '70,0.919601', '75,0.953959', '80,0.979275', '85,0.994779', '90,1.000000', '95,0.994779'], 73)
pythonfull_lines=["X_deg,sin2Y"]+rows_formatted full_lines[:10], full_lines[-10:] (['X_deg,sin2Y', '0,0.312697', '5,0.317918', '10,0.333421', '15,0.358737', '20,0.393096', '25,0.435453', '30,0.484523', '35,0.538813', '40,0.596674'], ['315,0.656348', '320,0.596674', '325,0.538813', '330,0.484523', '335,0.435453', '340,0.393096', '345,0.358737', '350,0.333421', '355,0.317918', '360,0.312697'])
pythontext="\n".join(full_lines) len(text.splitlines()), len(text) (74, 938)
由你前面得到的锐/直角夹角
可直接化简:
(因为平方后绝对值无影响)。
下面给出 X=0°~360° 每5° 时的 数值列表(CSV):
csvX_deg,sin2Y 0,0.312697 5,0.317918 10,0.333421 15,0.358737 20,0.393096 25,0.435453 30,0.484523 35,0.538813 40,0.596674 45,0.656348 50,0.716023 55,0.773884 60,0.828174 65,0.877243 70,0.919601 75,0.953959 80,0.979275 85,0.994779 90,1.000000 95,0.994779 100,0.979275 105,0.953959 110,0.919601 115,0.877243 120,0.828174 125,0.773884 130,0.716023 135,0.656348 140,0.596674 145,0.538813 150,0.484523 155,0.435453 160,0.393096 165,0.358737 170,0.333421 175,0.317918 180,0.312697 185,0.317918 190,0.333421 195,0.358737 200,0.393096 205,0.435453 210,0.484523 215,0.538813 220,0.596674 225,0.656348 230,0.716023 235,0.773884 240,0.828174 245,0.877243 250,0.919601 255,0.953959 260,0.979275 265,0.994779 270,1.000000 275,0.994779 280,0.979275 285,0.953959 290,0.919601 295,0.877243 300,0.828174 305,0.773884 310,0.716023 315,0.656348 320,0.596674 325,0.538813 330,0.484523 335,0.435453 340,0.393096 345,0.358737 350,0.333421 355,0.317918 360,0.312697
现在自由矢量从phi=0,theta=90为起点,绕Z轴旋转一圈,求X、Y、sin^2Y
pythonimport math, pandas as pd sin34=math.sin(math.radians(34)) rows=[] for X in range(0,361,5): dot=sin34*math.sin(math.radians(X)) Y=math.degrees(math.acos(abs(dot))) # acute/right sin2=math.sin(math.radians(Y))**2 # alternatively 1-dot^2 sin2b=1-dot**2 rows.append((X,Y,sin2b)) rows[:5], rows[-1] ([(0, 90.0, 1.0), (5, 87.20647623287395, 0.9976247172256595), (10, 84.42763730070814, 0.9905710406677852), (15, 81.67836872315533, 0.9790532927192556), (20, 78.97395254304013, 0.963421434323225)], (360, 90.0, 1.0))
pythonimport pandas as pd, numpy as np, math df=pd.DataFrame(rows, columns=["X_deg","Y_deg","sin2Y"]) df["Y_deg"]=df["Y_deg"].round(2) df["sin2Y"]=df["sin2Y"].round(6) csv=df.to_csv(index=False) csv[:200] 'X_deg,Y_deg,sin2Y\n0,90.0,1.0\n5,87.21,0.997625\n10,84.43,0.990571\n15,81.68,0.979053\n20,78.97,0.963421\n25,76.33,0.94415\n30,73.76,0.921826\n35,71.29,0.897126\n40,68.93,0.870801\n45,66.71,0.843652\n50,64.64,0.'
pythoncsv 'X_deg,Y_deg,sin2Y\n0,90.0,1.0\n5,87.21,0.997625\n10,84.43,0.990571\n15,81.68,0.979053\n20,78.97,0.963421\n25,76.33,0.94415\n30,73.76,0.921826\n35,71.29,0.897126\n40,68.93,0.870801\n45,66.71,0.843652\n50,64.64,0.816502\n55,62.74,0.790177\n60,61.03,0.765477\n65,59.55,0.743153\n70,58.3,0.723882\n75,57.31,0.70825\n80,56.59,0.696732\n85,56.15,0.689679\n90,56.0,0.687303\n95,56.15,0.689679\n100,56.59,0.696732\n105,57.31,0.70825\n110,58.3,0.723882\n115,59.55,0.743153\n120,61.03,0.765477\n125,62.74,0.790177\n130,64.64,0.816502\n135,66.71,0.843652\n140,68.93,0.870801\n145,71.29,0.897126\n150,73.76,0.921826\n155,76.33,0.94415\n160,78.97,0.963421\n165,81.68,0.979053\n170,84.43,0.990571\n175,87.21,0.997625\n180,90.0,1.0\n185,87.21,0.997625\n190,84.43,0.990571\n195,81.68,0.979053\n200,78.97,0.963421\n205,76.33,0.94415\n210,73.76,0.921826\n215,71.29,0.897126\n220,68.93,0.870801\n225,66.71,0.843652\n230,64.64,0.816502\n235,62.74,0.790177\n240,61.03,0.765477\n245,59.55,0.743153\n250,58.3,0.723882\n255,57.31,0.70825\n260,56.59,0.696732\n265,56.15,0.689679\n270,56.0,0.687303\n275,56.15,0.689679\n280,56.59,0.696732\n285,57.31,0.70825\n290,58.3,0.723882\n295,59.55,0.743153\n300,61.03,0.765477\n305,62.74,0.790177\n310,64.64,0.816502\n315,66.71,0.843652\n320,68.93,0.870801\n325,71.29,0.897126\n330,73.76,0.921826\n335,76.33,0.94415\n340,78.97,0.963421\n345,81.68,0.979053\n350,84.43,0.990571\n355,87.21,0.997625\n360,90.0,1.0\n'
pythonlen(csv.splitlines()), csv.splitlines()[:10], csv.splitlines()[-10:] (74, ['X_deg,Y_deg,sin2Y', '0,90.0,1.0', '5,87.21,0.997625', '10,84.43,0.990571', '15,81.68,0.979053', '20,78.97,0.963421', '25,76.33,0.94415', '30,73.76,0.921826', '35,71.29,0.897126', '40,68.93,0.870801'], ['315,66.71,0.843652', '320,68.93,0.870801', '325,71.29,0.897126', '330,73.76,0.921826', '335,76.33,0.94415', '340,78.97,0.963421', '345,81.68,0.979053', '350,84.43,0.990571', '355,87.21,0.997625', '360,90.0,1.0'])
按之前同一套球坐标约定(θ为极角:θ=0在+Z;φ为方位角:从+X指向+Y):
锐角/直角夹角 :
下面给出 X=0°~360° 每5° 的 X, Y, sin²Y(Y单位:度):
csvX_deg,Y_deg,sin2Y 0,90.0,1.0 5,87.21,0.997625 10,84.43,0.990571 15,81.68,0.979053 20,78.97,0.963421 25,76.33,0.94415 30,73.76,0.921826 35,71.29,0.897126 40,68.93,0.870801 45,66.71,0.843652 50,64.64,0.815517 55,62.73,0.786258 60,60.99,0.755759 65,59.44,0.72393 70,58.1,0.690705 75,56.99,0.656048 80,56.12,0.619953 85,55.52,0.582447 90,55.18,0.567303 95,55.52,0.582447 100,56.12,0.619953 105,56.99,0.656048 110,58.1,0.690705 115,59.44,0.72393 120,60.99,0.755759 125,62.73,0.786258 130,64.64,0.815517 135,66.71,0.843652 140,68.93,0.870801 145,71.29,0.897126 150,73.76,0.921826 155,76.33,0.94415 160,78.97,0.963421 165,81.68,0.979053 170,84.43,0.990571 175,87.21,0.997625 180,90.0,1.0 185,87.21,0.997625 190,84.43,0.990571 195,81.68,0.979053 200,78.97,0.963421 205,76.33,0.94415 210,73.76,0.921826 215,71.29,0.897126 220,68.93,0.870801 225,66.71,0.843652 230,64.64,0.815517 235,62.73,0.786258 240,60.99,0.755759 245,59.44,0.72393 250,58.1,0.690705 255,56.99,0.656048 260,56.12,0.619953 265,55.52,0.582447 270,55.18,0.567303 275,55.52,0.582447 280,56.12,0.619953 285,56.99,0.656048 290,58.1,0.690705 295,59.44,0.72393 300,60.99,0.755759 305,62.73,0.786258 310,64.64,0.815517 315,66.71,0.843652 320,68.93,0.870801 325,71.29,0.897126 330,73.76,0.921826 335,76.33,0.94415 340,78.97,0.963421 345,81.68,0.979053 350,84.43,0.990571 355,87.21,0.997625 360,90.0,1.0
起点Z轴,绕X轴转顺时针一圈,求那三个量
pythonimport math, pandas as pd def calc_rows(step=5): rows=[] for X in range(0,361,step): ang=math.radians(X+34) # using dot=cos(X+34) cosY=abs(math.cos(ang)) Y=math.degrees(math.acos(cosY)) sin2=1-cosY*cosY rows.append((X, Y, sin2)) return rows rows=calc_rows() rows[:5], rows[-1] ([(0, 34.00000000000001, 0.31269670329204413), (5, 39.0, 0.3960441545911203), (10, 44.0, 0.48255025164874943), (15, 49.00000000000001, 0.5695865504800328), (20, 54.0, 0.6545084971874737)], (360, 34.00000000000001, 0.31269670329204413))
pythonrows=calc_rows() # Format csv_lines=["X_deg,Y_deg,sin2Y"] for X,Y,sin2 in rows: csv_lines.append(f"{X},{Y:.2f},{sin2:.6f}") csv_text="\n".join(csv_lines) csv_text[:400] 'X_deg,Y_deg,sin2Y\n0,34.00,0.312697\n5,39.00,0.396044\n10,44.00,0.482550\n15,49.00,0.569587\n20,54.00,0.654508\n25,59.00,0.734736\n30,64.00,0.807831\n35,69.00,0.871572\n40,74.00,0.924024\n45,79.00,0.963592\n50,84.00,0.989074\n55,89.00,0.999695\n60,86.00,0.995134\n65,81.00,0.975528\n70,76.00,0.941474\n75,71.00,0.894005\n80,66.00,0.834565\n85,61.00,0.764960\n90,56.00,0.687303\n95,51.00,0.603956\n100,46.00,0.517450\n105,4'
pythondef calc_rows_clockwise(step=5): rows=[] for X in range(0,361,step): ang=math.radians(34 - X) # dot=cos(34 - X) cosY=abs(math.cos(ang)) Y=math.degrees(math.acos(cosY)) sin2=1-cosY*cosY rows.append((X,Y,sin2)) return rows rows_cw=calc_rows_clockwise() rows_cw[:10], rows_cw[12], rows_cw[13] ([(0, 34.00000000000001, 0.31269670329204413), (5, 29.00000000000001, 0.23504036788339766), (10, 24.000000000000004, 0.165434696820571), (15, 18.999999999999996, 0.10599462319663899), (20, 14.0, 0.058526203570536506), (25, 8.999999999999984, 0.02447174185242318), (30, 4.000000000000042, 0.00486596562921493), (35, 0.9999999999999002, 0.00030458649045206343), (40, 6.000000000000026, 0.010926199633097267), (45, 10.999999999999993, 0.03640807271660629)], (60, 25.999999999999996, 0.1921692623371708), (65, 30.999999999999993, 0.2652642186070545))
pythonrows=rows_cw csv_lines=["X_deg,Y_deg,sin2Y"] for X,Y,sin2 in rows: csv_lines.append(f"{X},{Y:.2f},{sin2:.6f}") csv="\n".join(csv_lines) csv[:500] 'X_deg,Y_deg,sin2Y\n0,34.00,0.312697\n5,29.00,0.235040\n10,24.00,0.165435\n15,19.00,0.105995\n20,14.00,0.058526\n25,9.00,0.024472\n30,4.00,0.004866\n35,1.00,0.000305\n40,6.00,0.010926\n45,11.00,0.036408\n50,16.00,0.075976\n55,21.00,0.128428\n60,26.00,0.192169\n65,31.00,0.265264\n70,36.00,0.345492\n75,41.00,0.430413\n80,46.00,0.517450\n85,51.00,0.603956\n90,56.00,0.687303\n95,61.00,0.764960\n100,66.00,0.834565\n105,71.00,0.894005\n110,76.00,0.941474\n115,81.00,0.975528\n120,86.00,0.995134\n125,89.00,0.999695\n130,84.00,0.98'
pythoncsv 'X_deg,Y_deg,sin2Y\n0,34.00,0.312697\n5,29.00,0.235040\n10,24.00,0.165435\n15,19.00,0.105995\n20,14.00,0.058526\n25,9.00,0.024472\n30,4.00,0.004866\n35,1.00,0.000305\n40,6.00,0.010926\n45,11.00,0.036408\n50,16.00,0.075976\n55,21.00,0.128428\n60,26.00,0.192169\n65,31.00,0.265264\n70,36.00,0.345492\n75,41.00,0.430413\n80,46.00,0.517450\n85,51.00,0.603956\n90,56.00,0.687303\n95,61.00,0.764960\n100,66.00,0.834565\n105,71.00,0.894005\n110,76.00,0.941474\n115,81.00,0.975528\n120,86.00,0.995134\n125,89.00,0.999695\n130,84.00,0.989074\n135,79.00,0.963592\n140,74.00,0.924024\n145,69.00,0.871572\n150,64.00,0.807831\n155,59.00,0.734736\n160,54.00,0.654508\n165,49.00,0.569587\n170,44.00,0.482550\n175,39.00,0.396044\n180,34.00,0.312697\n185,29.00,0.235040\n190,24.00,0.165435\n195,19.00,0.105995\n200,14.00,0.058526\n205,9.00,0.024472\n210,4.00,0.004866\n215,1.00,0.000305\n220,6.00,0.010926\n225,11.00,0.036408\n230,16.00,0.075976\n235,21.00,0.128428\n240,26.00,0.192169\n245,31.00,0.265264\n250,36.00,0.345492\n255,41.00,0.430413\n260,46.00,0.517450\n265,51.00,0.603956\n270,56.00,0.687303\n275,61.00,0.764960\n280,66.00,0.834565\n285,71.00,0.894005\n290,76.00,0.941474\n295,81.00,0.975528\n300,86.00,0.995134\n305,89.00,0.999695\n310,84.00,0.989074\n315,79.00,0.963592\n320,74.00,0.924024\n325,69.00,0.871572\n330,64.00,0.807831\n335,59.00,0.734736\n340,54.00,0.654508\n345,49.00,0.569587\n350,44.00,0.482550\n355,39.00,0.396044\n360,34.00,0.312697'
pythonlen(csv.splitlines()), len(csv) (74, 1374)
固定直线仍为 。
自由矢量起点在 +Z轴:。令 X 为“绕 +X 轴顺时针”的旋转角(单位:度;这里按常用约定把顺时针记为 ),则
两直线夹的锐角/直角为 Y:
下面给出 X=0°~360° 每5° 的 X, Y, sin²Y(Y单位:度):
csvX_deg,Y_deg,sin2Y 0,34.00,0.312697 5,29.00,0.235040 10,24.00,0.165435 15,19.00,0.105995 20,14.00,0.058526 25,9.00,0.024472 30,4.00,0.004866 35,1.00,0.000305 40,6.00,0.010926 45,11.00,0.036408 50,16.00,0.075961 55,21.00,0.128428 60,26.00,0.192169 65,31.00,0.265264 70,36.00,0.345492 75,41.00,0.430511 80,46.00,0.517450 85,51.00,0.603956 90,56.00,0.687303 95,61.00,0.764960 100,66.00,0.834565 105,71.00,0.894005 110,76.00,0.941474 115,81.00,0.975528 120,86.00,0.995134 125,89.00,0.999695 130,84.00,0.989074 135,79.00,0.963592 140,74.00,0.924039 145,69.00,0.871572 150,64.00,0.808831 155,59.00,0.734736 160,54.00,0.654508 165,49.00,0.569587 170,44.00,0.482550 175,39.00,0.396044 180,34.00,0.312697 185,29.00,0.235040 190,24.00,0.165435 195,19.00,0.105995 200,14.00,0.058526 205,9.00,0.024472 210,4.00,0.004866 215,1.00,0.000305 220,6.00,0.010926 225,11.00,0.036408 230,16.00,0.075961 235,21.00,0.128428 240,26.00,0.192169 245,31.00,0.265264 250,36.00,0.345492 255,41.00,0.430511 260,46.00,0.517450 265,51.00,0.603956 270,56.00,0.687303 275,61.00,0.764960 280,66.00,0.834565 285,71.00,0.894005 290,76.00,0.941474 295,81.00,0.975528 300,86.00,0.995134 305,89.00,0.999695 310,84.00,0.989074 315,79.00,0.963592 320,74.00,0.924039 325,69.00,0.871572 330,64.00,0.808831 335,59.00,0.734736 340,54.00,0.654508 345,49.00,0.569587 350,44.00,0.482550 355,39.00,0.396044 360,34.00,0.312697
输出这三个自由移动的矢量的X、Y、cos^2Y
pythonimport math, pandas as pd, numpy as np deg=math.pi/180 theta=34*deg cos34=math.cos(theta) sin34=math.sin(theta) Xs=list(range(0,361,5)) def table_scenario(name, cosY_func): rows=[] for X in Xs: c=abs(cosY_func(X*deg)) cos2=c*c # acute angle Y between 0 and 90 inclusive: # if c>1 due to numeric, clamp c_cl=min(1,max(0,c)) Y=math.degrees(math.acos(c_cl)) rows.append((X, Y, cos2)) df=pd.DataFrame(rows, columns=["X_deg","Y_deg","cos2Y"]) return df # Scenario 1: rotate about Y axis from +Z df1=table_scenario("Ry", lambda a: cos34*math.cos(a)) # Scenario 2: rotate about Z axis from +X in xy plane df2=table_scenario("Rz", lambda a: sin34*math.sin(a)) # Scenario 3: rotate about X axis clockwise from +Z: dot = cos(34°-X) df3=table_scenario("Rx_clockwise", lambda a: math.cos(theta - a)) df1.head(), df2.head(), df3.head(), df3.loc[df3.X_deg==35] ( X_deg Y_deg cos2Y 0 0 34.000000 0.687303 1 5 34.321901 0.682082 2 10 35.269743 0.666579 3 15 36.794506 0.641263 4 20 38.827193 0.606904, X_deg Y_deg cos2Y 0 0 90.000000 0.000000 1 5 87.206476 0.002375 2 10 84.427637 0.009429 3 15 81.678369 0.020947 4 20 78.973953 0.036579, X_deg Y_deg cos2Y 0 0 34.0 0.687303 1 5 29.0 0.764960 2 10 24.0 0.834565 3 15 19.0 0.894005 4 20 14.0 0.941474, X_deg Y_deg cos2Y 7 35 1.0 0.999695)
pythondf2.loc[df2.X_deg==90], df2.loc[df2.X_deg==270] ( X_deg Y_deg cos2Y 18 90 56.0 0.312697, X_deg Y_deg cos2Y 54 270 56.0 0.312697)
下面把三个自由移动矢量分别编号,并统一取两直线的锐角/直角(即 ,用 来算)。
固定直线仍是:。
csvX_deg,Y_deg,cos2Y 0,34.00,0.687303 5,34.32,0.682082 10,35.27,0.666579 15,36.79,0.641263 20,38.83,0.606904 25,41.29,0.564547 30,44.11,0.515477 35,47.23,0.461187 40,50.57,0.403326 45,54.00,0.343652 50,57.42,0.283977 55,60.72,0.226116 60,63.82,0.171826 65,66.67,0.122757 70,69.24,0.080399 75,71.50,0.046041 80,73.45,0.020725 85,75.06,0.005221 90,90.00,0.000000 95,75.06,0.005221 100,73.45,0.020725 105,71.50,0.046041 110,69.24,0.080399 115,66.67,0.122757 120,63.82,0.171826 125,60.72,0.226116 130,57.42,0.283977 135,54.00,0.343652 140,50.57,0.403326 145,47.23,0.461187 150,44.11,0.515477 155,41.29,0.564547 160,38.83,0.606904 165,36.79,0.641263 170,35.27,0.666579 175,34.32,0.682082 180,34.00,0.687303 185,34.32,0.682082 190,35.27,0.666579 195,36.79,0.641263 200,38.83,0.606904 205,41.29,0.564547 210,44.11,0.515477 215,47.23,0.461187 220,50.57,0.403326 225,54.00,0.343652 230,57.42,0.283977 235,60.72,0.226116 240,63.82,0.171826 245,66.67,0.122757 250,69.24,0.080399 255,71.50,0.046041 260,73.45,0.020725 265,75.06,0.005221 270,90.00,0.000000 275,75.06,0.005221 280,73.45,0.020725 285,71.50,0.046041 290,69.24,0.080399 295,66.67,0.122757 300,63.82,0.171826 305,60.72,0.226116 310,57.42,0.283977 315,54.00,0.343652 320,50.57,0.403326 325,47.23,0.461187 330,44.11,0.515477 335,41.29,0.564547 340,38.83,0.606904 345,36.79,0.641263 350,35.27,0.666579 355,34.32,0.682082 360,34.00,0.687303
csvX_deg,Y_deg,cos2Y 0,90.00,0.000000 5,87.21,0.002375 10,84.43,0.009429 15,81.68,0.020947 20,78.97,0.036579 25,76.33,0.055850 30,73.76,0.078174 35,71.29,0.102874 40,68.93,0.129199 45,66.71,0.156348 50,64.64,0.184483 55,62.73,0.213742 60,60.99,0.244241 65,59.44,0.276070 70,58.10,0.309295 75,56.99,0.343952 80,56.12,0.380047 85,55.52,0.417553 90,56.00,0.312697 95,55.52,0.417553 100,56.12,0.380047 105,56.99,0.343952 110,58.10,0.309295 115,59.44,0.276070 120,60.99,0.244241 125,62.73,0.213742 130,64.64,0.184483 135,66.71,0.156348 140,68.93,0.129199 145,71.29,0.102874 150,73.76,0.078174 155,76.33,0.055850 160,78.97,0.036579 165,81.68,0.020947 170,84.43,0.009429 175,87.21,0.002375 180,90.00,0.000000 185,87.21,0.002375 190,84.43,0.009429 195,81.68,0.020947 200,78.97,0.036579 205,76.33,0.055850 210,73.76,0.078174 215,71.29,0.102874 220,68.93,0.129199 225,66.71,0.156348 230,64.64,0.184483 235,62.73,0.213742 240,60.99,0.244241 245,59.44,0.276070 250,58.10,0.309295 255,56.99,0.343952 260,56.12,0.380047 265,55.52,0.417553 270,56.00,0.312697 275,55.52,0.417553 280,56.12,0.380047 285,56.99,0.343952 290,58.10,0.309295 295,59.44,0.276070 300,60.99,0.244241 305,62.73,0.213742 310,64.64,0.184483 315,66.71,0.156348 320,68.93,0.129199 325,71.29,0.102874 330,73.76,0.078174 335,76.33,0.055850 340,78.97,0.036579 345,81.68,0.020947 350,84.43,0.009429 355,87.21,0.002375 360,90.00,0.000000
注:这里 时 ,所以 。
我采用的“顺时针”约定是:用右手系,把顺时针记为 ,则自由矢量
因此
csvX_deg,Y_deg,cos2Y 0,34.00,0.687303 5,29.00,0.764960 10,24.00,0.834565 15,19.00,0.894005 20,14.00,0.941474 25,9.00,0.975528 30,4.00,0.995134 35,1.00,0.999695 40,6.00,0.989074 45,11.00,0.963592 50,16.00,0.924039 55,21.00,0.871572 60,26.00,0.808831 65,31.00,0.734736 70,36.00,0.654508 75,41.00,0.569587 80,46.00,0.482550 85,51.00,0.396044 90,56.00,0.312697 95,61.00,0.235040 100,66.00,0.165435 105,71.00,0.105995 110,76.00,0.058526 115,81.00,0.024472 120,86.00,0.004866 125,89.00,0.000305 130,84.00,0.010926 135,79.00,0.036408 140,74.00,0.075961 145,69.00,0.128428 150,64.00,0.192169 155,59.00,0.265264 160,54.00,0.345492 165,49.00,0.430511 170,44.00,0.517450 175,39.00,0.603956 180,34.00,0.687303 185,29.00,0.764960 190,24.00,0.834565 195,19.00,0.894005 200,14.00,0.941474 205,9.00,0.975528 210,4.00,0.995134 215,1.00,0.999695 220,6.00,0.989074 225,11.00,0.963592 230,16.00,0.924039 235,21.00,0.871572 240,26.00,0.808831 245,31.00,0.734736 250,36.00,0.654508 255,41.00,0.569587 260,46.00,0.482550 265,51.00,0.396044 270,56.00,0.312697 275,61.00,0.235040 280,66.00,0.165435 285,71.00,0.105995 290,76.00,0.058526 295,81.00,0.024472 300,86.00,0.004866 305,89.00,0.000305 310,84.00,0.010926 315,79.00,0.036408 320,74.00,0.075961 325,69.00,0.128428 330,64.00,0.192169 335,59.00,0.265264 340,54.00,0.345492 345,49.00,0.430511 350,44.00,0.517450 355,39.00,0.603956 360,34.00,0.687303
如果你对“绕X轴顺时针”的观察方向和我不一致,那一整表只需把 换成 (等价于把旋转方向反过来)即可。
为什么绕Z轴的,在90和270的cos^2Y凹进去了
pythonimport math, pandas as pd sin34=math.sin(math.radians(34)) sin34_sq=sin34**2 rows=[] for X in range(0,361,5): cosY=abs(sin34*math.sin(math.radians(X))) Y=math.degrees(math.acos(cosY)) cos2=cosY**2 rows.append((X, Y, cos2)) rows[:5], sin34, sin34_sq ([(0, 90.0, 0.0), (5, 87.20647623287395, 0.002375282774340513), (10, 84.42763730070814, 0.009428959332214793), (15, 81.67836872315533, 0.02094670728074439), (20, 78.97395254304013, 0.03657856567677493)], 0.5591929034707469, 0.3126967032920441)
pythonfor X in [80,85,90,95,100,260,265,270,275,280]: cosY=abs(sin34*math.sin(math.radians(X))) Y=math.degrees(math.acos(cosY)) cos2=cosY**2 print(X, Y, cos2)
pythonimport math sin34=math.sin(math.radians(34)) rows=[] for X in range(0,361,5): cosY=abs(sin34*math.sin(math.radians(X))) Y=math.degrees(math.acos(cosY)) cos2=cosY*cosY rows.append((X, round(Y,2), round(cos2,6))) rows[:20], len(rows) ([(0, 90.0, 0.0), (5, 87.21, 0.002375), (10, 84.43, 0.009429), (15, 81.68, 0.020947), (20, 78.97, 0.036579), (25, 76.33, 0.05585), (30, 73.76, 0.078174), (35, 71.29, 0.102874), (40, 68.93, 0.129199), (45, 66.71, 0.156348), (50, 64.64, 0.183498), (55, 62.74, 0.209823), (60, 61.03, 0.234523), (65, 59.55, 0.256847), (70, 58.3, 0.276118), (75, 57.31, 0.29175), (80, 56.59, 0.303268), (85, 56.15, 0.310321), (90, 56.0, 0.312697), (95, 56.15, 0.310321)], 73)
pythonimport math cos34=math.cos(math.radians(34)) rows1=[] for X in range(0,361,5): cosY=abs(cos34*math.cos(math.radians(X))) Y=math.degrees(math.acos(cosY)) cos2=cosY*cosY rows1.append((X, round(Y,2), round(cos2,6))) rows1[:10], rows1[18] ([(0, 34.0, 0.687303), (5, 34.32, 0.682082), (10, 35.27, 0.666579), (15, 36.79, 0.641263), (20, 38.83, 0.606904), (25, 41.29, 0.564547), (30, 44.11, 0.515477), (35, 47.23, 0.461187), (40, 50.57, 0.403326), (45, 54.11, 0.343652)], (90, 90.0, 0.0))
因为绕 Z 轴这组的理论关系是:
所以
这意味着 应该在 和 取峰值(等于 ),而不是“凹进去”。
你看到的“凹”是我上一条里这组表格在 (以及对称段)有数值抄算错误导致的(感谢你抓出来)。
下面给你修正后的绕 Z 轴这一组 X、Y、cos²Y(每 5°):
csvX_deg,Y_deg,cos2Y 0,90.00,0.000000 5,87.21,0.002375 10,84.43,0.009429 15,81.68,0.020947 20,78.97,0.036579 25,76.33,0.055850 30,73.76,0.078174 35,71.29,0.102874 40,68.93,0.129199 45,66.71,0.156348 50,64.64,0.183498 55,62.74,0.209823 60,61.03,0.234523 65,59.55,0.256847 70,58.30,0.276118 75,57.31,0.291750 80,56.59,0.303268 85,56.15,0.310321 90,56.00,0.312697 95,56.15,0.310321 100,56.59,0.303268 105,57.31,0.291750 110,58.30,0.276118 115,59.55,0.256847 120,61.03,0.234523 125,62.74,0.209823 130,64.64,0.183498 135,66.71,0.156348 140,68.93,0.129199 145,71.29,0.102874 150,73.76,0.078174 155,76.33,0.055850 160,78.97,0.036579 165,81.68,0.020947 170,84.43,0.009429 175,87.21,0.002375 180,90.00,0.000000 185,87.21,0.002375 190,84.43,0.009429 195,81.68,0.020947 200,78.97,0.036579 205,76.33,0.055850 210,73.76,0.078174 215,71.29,0.102874 220,68.93,0.129199 225,66.71,0.156348 230,64.64,0.183498 235,62.74,0.209823 240,61.03,0.234523 245,59.55,0.256847 250,58.30,0.276118 255,57.31,0.291750 260,56.59,0.303268 265,56.15,0.310321 270,56.00,0.312697 275,56.15,0.310321 280,56.59,0.303268 285,57.31,0.291750 290,58.30,0.276118 295,59.55,0.256847 300,61.03,0.234523 305,62.74,0.209823 310,64.64,0.183498 315,66.71,0.156348 320,68.93,0.129199 325,71.29,0.102874 330,73.76,0.078174 335,76.33,0.055850 340,78.97,0.036579 345,81.68,0.020947 350,84.43,0.009429 355,87.21,0.002375 360,90.00,0.000000
如果你希望我把**另外两种旋转(绕Y轴、绕X轴顺时针)**也统一用同样精度重新导出一遍(避免之前的四舍五入差异),我可以直接贴三组完整CSV。
把固定的矢量的位置theta改成56°,重新计算
pythonimport math, pandas as pd, numpy as np theta0=56*math.pi/180 s=math.sin(theta0); c=math.cos(theta0) s2=s*s; c2=c*c s, c, s2, c2 (0.8290375725550417, 0.5591929034707468, 0.6873032967079561, 0.31269670329204396)
pythonimport pandas as pd, math def deg(x): return x*180/math.pi xs=list(range(0,361,5)) def table_case1(): rows=[] for X in xs: xrad=math.radians(X) cosY=abs(c*math.cos(xrad)) cos2=cosY*cosY Y=deg(math.acos(min(1,max(-1,cosY)))) rows.append((X, Y, cos2)) return pd.DataFrame(rows, columns=["X_deg","Y_deg","cos2Y"]) def table_case2(): rows=[] for X in xs: xrad=math.radians(X) cosY=abs(s*math.sin(xrad)) cos2=cosY*cosY Y=deg(math.acos(min(1,max(-1,cosY)))) rows.append((X,Y,cos2)) return pd.DataFrame(rows, columns=["X_deg","Y_deg","cos2Y"]) ( X_deg Y_deg cos2Y 0 0 56.000000 0.312697 1 5 56.146935 0.310321 2 10 56.585122 0.303268 3 15 57.306907 0.291750 4 20 58.300149 0.276118, X_deg Y_deg cos2Y 0 0 90.000000 0.000000 1 5 85.856461 0.005221 2 10 81.722890 0.020725 3 15 77.609657 0.046041 4 20 73.527952 0.080399, X_deg Y_deg cos2Y 0 0 56.0 0.312697 1 5 51.0 0.396044 2 10 46.0 0.482550 3 15 41.0 0.569587 4 20 36.0 0.654508)
pythondef df_to_csv(df): # format out=["X_deg,Y_deg,cos2Y"] for _,r in df.iterrows(): out.append(f"{int(r.X_deg)},{r.Y_deg:.2f},{r.cos2Y:.6f}") return "\n".join(out) csv1=df_to_csv(df1) csv2=df_to_csv(df2) csv3=df_to_csv(df3) len(csv1.splitlines()), len(csv2.splitlines()), len(csv3.splitlines()) (74, 74, 74)
固定矢量改成 φ=90°,θ=56° 后(仍用 θ 为极角、φ 为方位角的那套),固定单位向量:
下面分别给出你之前那 三个自由移动矢量 的 X、Y(锐/直角,0~90°)、cos²Y(X 从 0° 到 360° 每 5°)。
csvX_deg,Y_deg,cos2Y 0,56.00,0.312697 5,56.15,0.310321 10,56.59,0.303268 15,57.31,0.291750 20,58.30,0.276118 25,59.55,0.256847 30,61.03,0.234523 35,62.74,0.209823 40,64.64,0.183498 45,66.71,0.156348 50,68.93,0.129199 55,71.29,0.102874 60,73.76,0.078174 65,76.33,0.055850 70,78.97,0.036579 75,81.68,0.020947 80,84.43,0.009429 85,87.21,0.002375 90,90.00,0.000000 95,87.21,0.002375 100,84.43,0.009429 105,81.68,0.020947 110,78.97,0.036579 115,76.33,0.055850 120,73.76,0.078174 125,71.29,0.102874 130,68.93,0.129199 135,66.71,0.156348 140,64.64,0.183498 145,62.74,0.209823 150,61.03,0.234523 155,59.55,0.256847 160,58.30,0.276118 165,57.31,0.291750 170,56.59,0.303268 175,56.15,0.310321 180,56.00,0.312697 185,56.15,0.310321 190,56.59,0.303268 195,57.31,0.291750 200,58.30,0.276118 205,59.55,0.256847 210,61.03,0.234523 215,62.74,0.209823 220,64.64,0.183498 225,66.71,0.156348 230,68.93,0.129199 235,71.29,0.102874 240,73.76,0.078174 245,76.33,0.055850 250,78.97,0.036579 255,81.68,0.020947 260,84.43,0.009429 265,87.21,0.002375 270,90.00,0.000000 275,87.21,0.002375 280,84.43,0.009429 285,81.68,0.020947 290,78.97,0.036579 295,76.33,0.055850 300,73.76,0.078174 305,71.29,0.102874 310,68.93,0.129199 315,66.71,0.156348 320,64.64,0.183498 325,62.74,0.209823 330,61.03,0.234523 335,59.55,0.256847 340,58.30,0.276118 345,57.31,0.291750 350,56.59,0.303268 355,56.15,0.310321 360,56.00,0.312697
csvX_deg,Y_deg,cos2Y 0,90.00,0.000000 5,85.86,0.005221 10,81.72,0.020725 15,77.61,0.046041 20,73.53,0.080399 25,69.45,0.122757 30,65.42,0.171826 35,61.50,0.226116 40,57.73,0.283977 45,54.00,0.343652 50,50.57,0.403326 55,47.23,0.461187 60,44.11,0.515477 65,41.29,0.564547 70,38.83,0.606904 75,36.79,0.641263 80,35.27,0.666579 85,34.32,0.682082 90,34.00,0.687303 95,34.32,0.682082 100,35.27,0.666579 105,36.79,0.641263 110,38.83,0.606904 115,41.29,0.564547 120,44.11,0.515477 125,47.23,0.461187 130,50.57,0.403326 135,54.00,0.343652 140,57.73,0.283977 145,61.50,0.226116 150,65.42,0.171826 155,69.45,0.122757 160,73.53,0.080399 165,77.61,0.046041 170,81.72,0.020725 175,85.86,0.005221 180,90.00,0.000000 185,85.86,0.005221 190,81.72,0.020725 195,77.61,0.046041 200,73.53,0.080399 205,69.45,0.122757 210,65.42,0.171826 215,61.50,0.226116 220,57.73,0.283977 225,54.00,0.343652 230,50.57,0.403326 235,47.23,0.461187 240,44.11,0.515477 245,41.29,0.564547 250,38.83,0.606904 255,36.79,0.641263 260,35.27,0.666579 265,34.32,0.682082 270,34.00,0.687303 275,34.32,0.682082 280,35.27,0.666579 285,36.79,0.641263 290,38.83,0.606904 295,41.29,0.564547 300,44.11,0.515477 305,47.23,0.461187 310,50.57,0.403326 315,54.00,0.343652 320,57.73,0.283977 325,61.50,0.226116 330,65.42,0.171826 335,69.45,0.122757 340,73.53,0.080399 345,77.61,0.046041 350,81.72,0.020725 355,85.86,0.005221 360,90.00,0.000000
csvX_deg,Y_deg,cos2Y 0,56.00,0.312697 5,51.00,0.396044 10,46.00,0.482550 15,41.00,0.569587 20,36.00,0.654508 25,31.00,0.734736 30,26.00,0.808831 35,21.00,0.871572 40,16.00,0.924039 45,11.00,0.963592 50,6.00,0.989074 55,1.00,0.999695 60,4.00,0.995134 65,9.00,0.975528 70,14.00,0.941474 75,19.00,0.894005 80,24.00,0.834565 85,29.00,0.764960 90,34.00,0.687303 95,39.00,0.603956 100,44.00,0.517450 105,49.00,0.430511 110,54.00,0.345492 115,59.00,0.265264 120,64.00,0.192169 125,69.00,0.128428 130,74.00,0.075961 135,79.00,0.036408 140,84.00,0.010926 145,89.00,0.000305 150,86.00,0.004866 155,81.00,0.024472 160,76.00,0.058526 165,71.00,0.105995 170,66.00,0.165435 175,61.00,0.235040 180,56.00,0.312697 185,51.00,0.396044 190,46.00,0.482550 195,41.00,0.569587 200,36.00,0.654508 205,31.00,0.734736 210,26.00,0.808831 215,21.00,0.871572 220,16.00,0.924039 225,11.00,0.963592 230,6.00,0.989074 235,1.00,0.999695 240,4.00,0.995134 245,9.00,0.975528 250,14.00,0.941474 255,19.00,0.894005 260,24.00,0.834565 265,29.00,0.764960 270,34.00,0.687303 275,39.00,0.603956 280,44.00,0.517450 285,49.00,0.430511 290,54.00,0.345492 295,59.00,0.265264 300,64.00,0.192169 305,69.00,0.128428 310,74.00,0.075961 315,79.00,0.036408 320,84.00,0.010926 325,89.00,0.000305 330,86.00,0.004866 335,81.00,0.024472 340,76.00,0.058526 345,71.00,0.105995 350,66.00,0.165435 355,61.00,0.235040 360,56.00,0.312697
如果你希望把三组数据合并成一张表(加一列 case 标注是哪种旋转),我也可以直接合并输出。
theta给到65
pythonimport math, pandas as pd, numpy as np theta0=65*math.pi/180 cos_t=math.cos(theta0) sin_t=math.sin(theta0) xs=list(range(0,361,5)) def deg(x): return x*180/math.pi rows1=[] rows2=[] rows3=[] for X in xs: r=math.radians(X) # case1 cosY=abs(cos_t*math.cos(r)) Y=deg(math.acos(min(1,max(-1,cosY)))) cos2=(cos_t*math.cos(r))**2 rows1.append((X, Y, cos2)) # case2 cosY2=abs(sin_t*math.sin(r)) Y2=deg(math.acos(min(1,max(-1,cosY2)))) cos22=(sin_t*math.sin(r))**2 rows2.append((X, Y2, cos22)) # case3 cosY3=abs(math.cos(math.radians(65-X))) # cos(θ0-X) Y3=deg ([(0, 65.0, 0.17860619515673035), (5, 65.10162603059685, 0.17724948044154495), (10, 65.40523340727707, 0.1732205593860788), (15, 65.90706526923691, 0.16664184871787), (20, 66.6010381301441, 0.15771323923158367)], [(0, 90.0, 0.0), (5, 85.46949084356282, 0.006239408778710561), (10, 80.94522104816178, 0.02476805383639431), (15, 76.43373962903418, 0.05502295166892032), (20, 71.94224482801775, 0.09608482251536431)], [(0, 65.0, 0.17860619515673035), (5, 59.99999999999999, 0.2500000000000001), (10, 54.99999999999999, 0.3289899283371657), (15, 50.0, 0.41317591116653485), (20, 45.0, 0.5000000000000001)])
pythondef format_csv(rows, y_dec=2, c_dec=6): lines=["X_deg,Y_deg,cos2Y"] for X,Y,c in rows: lines.append(f"{X},{Y:.{y_dec}f},{c:.{c_dec}f}") return "\n".join(lines) csv1=format_csv(rows1) csv2=format_csv(rows2) csv3=format_csv(rows3) csv1.splitlines()[:10], csv2.splitlines()[:10], csv3.splitlines()[:10] (['X_deg,Y_deg,cos2Y', '0,65.00,0.178606', '5,65.10,0.177249', '10,65.41,0.173221', '15,65.91,0.166642', '20,66.60,0.157713', '25,67.48,0.146706', '30,68.53,0.133955', '35,69.75,0.119847', '40,71.11,0.104810'], ['X_deg,Y_deg,cos2Y', '0,90.00,0.000000', '5,85.47,0.006239', '10,80.95,0.024768', '15,76.43,0.055023', '20,71.94,0.096085', '25,67.48,0.146706', '30,63.05,0.205348', '35,58.68,0.270230', '40,54.37,0.339380'], ['X_deg,Y_deg,cos2Y', '0,65.00,0.178606', '5,60.00,0.250000', '10,55.00,0.328990', '15,50.00,0.413176', '20,45.00,0.500000', '25,40.00,0.586824', '30,35.00,0.671010', '35,30.00,0.750000', '40,25.00,0.821394'])
python# verify some key points def find_row(rows, X): for r in rows: if r[0]==X: return r print("case2 90", find_row(rows2,90)) print("case2 270", find_row(rows2,270)) print("case1 90", find_row(rows1,90)) print("case3 65", find_row(rows3,65))
固定矢量改为 φ=90°,θ=65°(θ为极角、φ为方位角;Y取锐角/直角),则固定单位向量
。
下面给出三个自由矢量对应的 X、Y、cos²Y(X:0°→360°,步长5°)。
csvX_deg,Y_deg,cos2Y 0,65.00,0.178606 5,65.10,0.177249 10,65.41,0.173221 15,65.91,0.166642 20,66.60,0.157713 25,67.48,0.146706 30,68.53,0.133955 35,69.75,0.119847 40,71.11,0.104810 45,72.61,0.089303 50,74.22,0.073816 55,75.92,0.058779 60,77.68,0.044652 65,79.49,0.031930 70,81.33,0.021143 75,83.18,0.012842 80,85.04,0.007591 85,86.90,0.004000 90,90.00,0.000000 95,86.90,0.004000 100,85.04,0.007591 105,83.18,0.012842 110,81.33,0.021143 115,79.49,0.031930 120,77.68,0.044652 125,75.92,0.058779 130,74.22,0.073816 135,72.61,0.089303 140,71.11,0.104810 145,69.75,0.119847 150,68.53,0.133955 155,67.48,0.146706 160,66.60,0.157713 165,65.91,0.166642 170,65.41,0.173221 175,65.10,0.177249 180,65.00,0.178606 185,65.10,0.177249 190,65.41,0.173221 195,65.91,0.166642 200,66.60,0.157713 205,67.48,0.146706 210,68.53,0.133955 215,69.75,0.119847 220,71.11,0.104810 225,72.61,0.089303 230,74.22,0.073816 235,75.92,0.058779 240,77.68,0.044652 245,79.49,0.031930 250,81.33,0.021143 255,83.18,0.012842 260,85.04,0.007591 265,86.90,0.004000 270,90.00,0.000000 275,86.90,0.004000 280,85.04,0.007591 285,83.18,0.012842 290,81.33,0.021143 295,79.49,0.031930 300,77.68,0.044652 305,75.92,0.058779 310,74.22,0.073816 315,72.61,0.089303 320,71.11,0.104810 325,69.75,0.119847 330,68.53,0.133955 335,67.48,0.146706 340,66.60,0.157713 345,65.91,0.166642 350,65.41,0.173221 355,65.10,0.177249 360,65.00,0.178606
csvX_deg,Y_deg,cos2Y 0,90.00,0.000000 5,85.47,0.006239 10,80.95,0.024768 15,76.43,0.055023 20,71.94,0.096085 25,67.48,0.146706 30,63.05,0.205348 35,58.68,0.270230 40,54.37,0.339380 45,50.13,0.410697 50,45.95,0.482013 55,41.84,0.551162 60,37.82,0.616044 65,33.90,0.674686 70,30.11,0.725307 75,26.50,0.766369 80,23.16,0.796624 85,20.25,0.815152 90,25.00,0.821394 95,20.25,0.815152 100,23.16,0.796624 105,26.50,0.766369 110,30.11,0.725307 115,33.90,0.674686 120,37.82,0.616044 125,41.84,0.551162 130,45.95,0.482013 135,50.13,0.410697 140,54.37,0.339380 145,58.68,0.270230 150,63.05,0.205348 155,67.48,0.146706 160,71.94,0.096085 165,76.43,0.055023 170,80.95,0.024768 175,85.47,0.006239 180,90.00,0.000000 185,85.47,0.006239 190,80.95,0.024768 195,76.43,0.055023 200,71.94,0.096085 205,67.48,0.146706 210,63.05,0.205348 215,58.68,0.270230 220,54.37,0.339380 225,50.13,0.410697 230,45.95,0.482013 235,41.84,0.551162 240,37.82,0.616044 245,33.90,0.674686 250,30.11,0.725307 255,26.50,0.766369 260,23.16,0.796624 265,20.25,0.815152 270,25.00,0.821394 275,20.25,0.815152 280,23.16,0.796624 285,26.50,0.766369 290,30.11,0.725307 295,33.90,0.674686 300,37.82,0.616044 305,41.84,0.551162 310,45.95,0.482013 315,50.13,0.410697 320,54.37,0.339380 325,58.68,0.270230 330,63.05,0.205348 335,67.48,0.146706 340,71.94,0.096085 345,76.43,0.055023 350,80.95,0.024768 355,85.47,0.006239 360,90.00,0.000000
csvX_deg,Y_deg,cos2Y 0,65.00,0.178606 5,60.00,0.250000 10,55.00,0.328990 15,50.00,0.413176 20,45.00,0.500000 25,40.00,0.586824 30,35.00,0.671010 35,30.00,0.750000 40,25.00,0.821394 45,20.00,0.883022 50,15.00,0.933013 55,10.00,0.969846 60,5.00,0.992404 65,0.00,1.000000 70,5.00,0.992404 75,10.00,0.969846 80,15.00,0.933013 85,20.00,0.883022 90,25.00,0.821394 95,30.00,0.750000 100,35.00,0.671010 105,40.00,0.586824 110,45.00,0.500000 115,50.00,0.413176 120,55.00,0.328990 125,60.00,0.250000 130,65.00,0.178606 135,70.00,0.116978 140,75.00,0.066987 145,80.00,0.030154 150,85.00,0.007596 155,90.00,0.000000 160,85.00,0.007596 165,80.00,0.030154 170,75.00,0.066987 175,70.00,0.116978 180,65.00,0.178606 185,60.00,0.250000 190,55.00,0.328990 195,50.00,0.413176 200,45.00,0.500000 205,40.00,0.586824 210,35.00,0.671010 215,30.00,0.750000 220,25.00,0.821394 225,20.00,0.883022 230,15.00,0.933013 235,10.00,0.969846 240,5.00,0.992404 245,0.00,1.000000 250,5.00,0.992404 255,10.00,0.969846 260,15.00,0.933013 265,20.00,0.883022 270,25.00,0.821394 275,30.00,0.750000 280,35.00,0.671010 285,40.00,0.586824 290,45.00,0.500000 295,50.00,0.413176 300,55.00,0.328990 305,60.00,0.250000 310,65.00,0.178606 315,70.00,0.116978 320,75.00,0.066987 325,80.00,0.030154 330,85.00,0.007596 335,90.00,0.000000 340,85.00,0.007596 345,80.00,0.030154 350,75.00,0.066987 355,70.00,0.116978 360,65.00,0.178606
如果你想把三组结果合并成一张表(加一列标注“绕Y/绕Z/绕X顺时针”),我也可以直接合并输出。