当前位置:网站首页>20220621 Dual Quaternion

20220621 Dual Quaternion

2022-06-23 07:04:00 What's my name


Pair even

One 、 Yes, what is even number ?

https://zhuanlan.zhihu.com/p/358146509

It is a special self consistent operation for even numbers , Similar to the common plural basic unit i i i i 2 = − 1 i^2=-1 i2=1), Here mathematicians define even basic units as ϵ \epsilon ϵ ϵ 2 = 0 \epsilon^2=0 ϵ2=0 And ϵ ≠ 0 \epsilon\neq0 ϵ=0).

Similar to the definition of the plural a + i b a+ib a+ib, The definition of an even number is a + ϵ b a+\epsilon b a+ϵb.

Based on the above definition , Define two pairs of even numbers d 1 = a 1 + ϵ b 1 d_1=a_1+\epsilon b_1 d1=a1+ϵb1 and d 2 = a 2 + ϵ b 2 d_2=a_2+\epsilon b_2 d2=a2+ϵb2 , According to the general algorithm, we can get the operation of even numbers :
k d 1 = ( k a 1 ) + ϵ ( k b 1 ) d 1 + d 2 = ( a 1 + a 2 ) + ϵ ( b 1 + b 2 ) d 1 d 2 = a 1 a 2 + ϵ ( a 1 b 2 + a 2 b 1 ) + ϵ 2 b 1 b 2 = a 1 a 2 + ϵ ( a 1 b 2 + a 2 b 1 ) d 1 ∗ = a 1 − ϵ b 1 ∣ d 1 ∣ = d 1 d 1 ∗ = ∣ a 1 ∣ d 1 − 1 = 1 a 1 + ϵ b 1 = a 1 − ϵ b 1 a 1 2 = 1 a 1 − ϵ b 1 a 1 2 if  a 1 ≠ 0 d 2 d 1 = a 2 + ϵ b 2 a 1 + ϵ b 1 = ( a 2 + ϵ b 2 ) ( a 1 − ϵ b 1 ) ( a 1 + ϵ b 1 ) ( a 1 − ϵ b 1 ) = a 1 a 2 + ϵ ( a 1 b 2 − a 2 b 1 ) a 1 2 = a 2 a 1 + ϵ ( b 2 a 1 − a 2 b 1 a 1 2 ) if  a 1 ≠ 0 \begin{aligned} k d_1&= (k a_1) + \epsilon (k b_1) \\ d_1+d_2 &= (a_1+a_2) + \epsilon (b_1+b_2) \\ d_1d_2 &=a_1a_2+ \epsilon (a_1b_2+a_2b_1)+\epsilon^2b_1b_2=a_1a_2+ \epsilon (a_1b_2+a_2b_1) \\ d_1^* &=a_1-\epsilon b_1 \\ |d_1| & = \sqrt{d_1d_1^*}=|a_1| \\ d_1^{-1}&=\frac{1}{a_1+\epsilon b_1}=\frac{a_1-\epsilon b_1}{a_1^2}=\frac{1}{a_1}-\epsilon\frac{b_1}{a_1^2} \quad \text{if}~ a_1\neq 0 \\ \frac{d_2}{d_1}&=\frac{a_2+\epsilon b_2}{a_1+\epsilon b_1}=\frac{(a_2+\epsilon b_2)(a_1-\epsilon b_1)}{(a_1+\epsilon b_1)(a_1-\epsilon b_1)}=\frac{a_1a_2+\epsilon(a_1b_2-a_2b_1)}{a_1^2}=\frac{a_2}{a_1}+\epsilon(\frac{b_2}{a_1}-\frac{a_2b_1}{a_1^2}) \quad \text{if}~ a_1\neq 0 \end{aligned} kd1d1+d2d1d2d1d1d11d1d2=(ka1)+ϵ(kb1)=(a1+a2)+ϵ(b1+b2)=a1a2+ϵ(a1b2+a2b1)+ϵ2b1b2=a1a2+ϵ(a1b2+a2b1)=a1ϵb1=d1d1=a1=a1+ϵb11=a12a1ϵb1=a11ϵa12b1if a1=0=a1+ϵb1a2+ϵb2=(a1+ϵb1)(a1ϵb1)(a2+ϵb2)(a1ϵb1)=a12a1a2+ϵ(a1b2a2b1)=a1a2+ϵ(a1b2a12a2b1)if a1=0

The best thing about even numbers is Taylor expansion , The superfluous items immediately disappear , namely
f ( a + ϵ b ) = f ( a ) + ϵ b f ′ ( a ) + ϵ 2 ( …   ) = f ( a ) + ϵ b f ′ ( a ) f(a+\epsilon b)=f(a)+\epsilon b f'(a)+\epsilon^2(\dots)=f(a)+\epsilon b f'(a) f(a+ϵb)=f(a)+ϵbf(a)+ϵ2()=f(a)+ϵbf(a) therefore , Further, we can get e a + ϵ b = e a + ϵ b e a ln ⁡ ( a + ϵ b ) = ln ⁡ ( a ) + ϵ b 1 a if  a ≠ 0 sin ⁡ ( a + ϵ b ) = sin ⁡ ( a ) + ϵ b cos ⁡ ( a ) cos ⁡ ( a + ϵ b ) = cos ⁡ ( a ) − ϵ b sin ⁡ ( a ) \begin{aligned} e^{a+\epsilon b}&=e^{a}+\epsilon b e^a \\ \ln(a+\epsilon b)&=\ln(a)+\epsilon b\frac{1}{a}\quad \text{if}~ a\neq 0 \\ \sin(a+\epsilon b)&=\sin(a)+\epsilon b \cos(a) \\ \cos(a+\epsilon b)&=\cos(a)-\epsilon b \sin(a) \end{aligned} ea+ϵbln(a+ϵb)sin(a+ϵb)cos(a+ϵb)=ea+ϵbea=ln(a)+ϵba1if a=0=sin(a)+ϵbcos(a)=cos(a)ϵbsin(a)

further , You can find f ′ ( a ) = f ( a + ϵ b ) − f ( a ) ϵ b f'(a)=\frac{f(a+\epsilon b)-f(a)}{\epsilon b } f(a)=ϵbf(a+ϵb)f(a) Note that this is direct linearization , Instead of approximate linearization , This can be used to calculate the derivative .

Two 、 Dual vector

Zhaihongmin . A dual quaternion based approach for spacecraft position and attitude synchronization planning and control . Harbin Institute of Technology , 2021

Dual vector d = a + ϵ b \boldsymbol{d}=\boldsymbol{a}+\epsilon \boldsymbol{b} d=a+ϵb , a , b ∈ R n \boldsymbol{a},\boldsymbol{b}\in\mathbb{R}^n a,bRn, And then there is
d = [ a 1 a 2 ⋮ a n ] + ϵ [ b 1 b 2 ⋮ b n ] = [ a 1 + ϵ b 1 a 2 + ϵ b n ⋮ a n + ϵ b n ] \boldsymbol{d}=\left[\begin{array}{c} a_{1} \\ a_{2} \\ \vdots \\ a_{n} \end{array}\right]+\epsilon \left[\begin{array}{c} b_{1} \\ b_{2} \\ \vdots \\ b_{n} \end{array}\right]=\left[\begin{array}{c} a_1+\epsilon b_1 \\ a_2+\epsilon b_n \\ \vdots \\ a_n+\epsilon b_n \end{array}\right] d=a1a2an+ϵb1b2bn=a1+ϵb1a2+ϵbnan+ϵbn in other words , It can be seen as both the real part 、 The dual parts are all pairs of even numbers composed of vectors , At the same time, it is regarded as a vector with pairs of even numbers as elements .

Any line in space can be described by unit dual vector . As shown in the figure below , A straight line R \boldsymbol{R} R It can be expressed as l + ϵ m \boldsymbol{l}+\epsilon \boldsymbol{m} l+ϵm, l \boldsymbol{l} l Displays the parallel direction of the line , m \boldsymbol{m} m Displays the vertical distance between the line and the origin . The unit dual vector here is usually called pruck (Plücker) A straight line .

 Insert picture description here


3、 ... and 、 Dual four elements

Dual quaternions can be regarded as Elements are quaternions of even numbers , It can also be regarded as a pair of even numbers whose elements are quaternions , namely
q ^ = [ η ^ , ξ ^ ] = q + ϵ q ′ = η + ξ 1 i + ξ 2 j + ξ 3 k + ϵ ( η ′ + ξ 1 ′ i + ξ 2 ′ j + ξ 3 ′ k ) \begin{aligned}\hat{\boldsymbol q}&=[\hat{\eta},\hat{\boldsymbol{\xi}}]=\boldsymbol q+\epsilon \boldsymbol q' \\ &=\eta+\xi_1\boldsymbol{i}+\xi_2\boldsymbol{j}+\xi_3\boldsymbol{k}+\epsilon\left( \eta'+\xi_1'\boldsymbol{i}+\xi_2'\boldsymbol{j}+\xi_3'\boldsymbol{k} \right) \end{aligned} q^=[η^,ξ^]=q+ϵq=η+ξ1i+ξ2j+ξ3k+ϵ(η+ξ1i+ξ2j+ξ3k)

The conjugation here is different from the one above , Because we think of it as Elements are quaternions of even numbers . Why not take it as the conjugation of even numbers whose elements are quaternions , See https://blog.csdn.net/weixin_44382195/article/details/125400408?spm=1001.2014.3001.5501.
q ^ ∗ = q ∗ + ϵ q ′ ∗ \hat{\boldsymbol q}^*=\boldsymbol q^*+\epsilon \boldsymbol q'^* q^=q+ϵq

Two 、 Use steps

1. Import and stock in

The code is as follows ( Example ):

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import warnings
warnings.filterwarnings('ignore')
import  ssl
ssl._create_default_https_context = ssl._create_unverified_context

2. Read in the data

The code is as follows ( Example ):

data = pd.read_csv(
    'https://labfile.oss.aliyuncs.com/courses/1283/adult.data.csv')
print(data.head())

It's used here url Data requested by the network .


summary

Tips : Here is a summary of the article :
for example : That's what we're going to talk about today , This article only briefly introduces pandas Use , and pandas Provides a large number of functions and methods that enable us to process data quickly and conveniently .

原网站

版权声明
本文为[What's my name]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206230528013357.html