Posts

  • 彩虹的数学

  • 将水滴看作圆球,光线入射到水滴中,经过一次反射,最后再经一次折射离开水滴。光路示意图如下图所示。 通过几何分析计算,可求得入射光偏转角与入射角的关系 其中,为水的折射率,下图中. 净偏转角随入射角变化的曲线如上图所示。在入射角附近,净偏转角最小,且净偏转角随入射角变化率几乎为0,大量不同入射角的光线最后具有几乎相同的出射方向。这就意味着,在这一出射方向,存在光线的密集效应。这就是我们看到彩虹所在的方向。 Python 3 code import numpy as np import matplotlib.pyplot as plt import os theta_i_list = np.arange(25,75,0.1) # def calc_theta_D(theta_i): n = 4/3 theta_r = np.rad2deg(np.arcsin(np.sin(np.deg2rad(theta_i))/n)) theta_D = 180 + 2*theta_i - 4*theta_r return theta_D # theta_D_list = calc_theta_D(theta_i_list) min_theta_D_idx = np.where(theta_D_list == np.min(theta_D_list))[0][0] min_theta_D = theta_D_list[min_theta_D_idx] min_theta_i = theta_i_list[min_theta_D_idx] fig = plt.figure() plt.plot(theta_i_list, theta_D_list) plt.xlabel(r'$\theta_i$') plt.ylabel(r'$\theta_D$') plt.axis([25, 75,... Read more
  • Using the arXiv API

  • Python 3 code import urllib.request as ur url = 'http://export.arxiv.org/api/query?search_query=all:electron&start=0&max_results=1' data = ur.urlopen(url).read() print(data) Ref: arXiv API Read more
  • \(\LaTeX{}\) PPT Tutorial

  • Preview Example fallback content: This browser does not support PDFs. Please download the PDF to view it: Download PDF. Code beamer-tutorial.tex \documentclass[mathserif]{beamer} \usepackage{pgfplots} \usepackage{multicol} \usetheme[progressbar=frametitle]{metropolis} \setbeamertemplate{frame numbering}[fraction] \useoutertheme{metropolis} \useinnertheme{metropolis} \usefonttheme{metropolis} \usecolortheme{spruce} \setbeamercolor{background caanvas}{bg=white} % \usetheme{Warsaw} \definecolor{mygreen}{rgb}{.125,.5,.25} \usecolortheme[named=mygreen]{structure} \title{Functions, Limits, DerivativesRead more
  • Enable SSH on Ubuntu 18.04 Bionic Beaver Linux

  • Contents Objective Operating System and Software Versions Requirements Difficulty Conventions Instructions Enable SSH on Ubuntu Enable/Disable SSH on Ubuntu Objective The below guide will provide you with information on how to enable ssh on Ubuntu 18.04 Linux. SSH stands for secure shell which allows encrypted remote login connections between client and server over insecure network. Operating System and Software Versions - Operating System: - Ubuntu 18.04 Bionic Beaver - Software: - OpenSSH 7.5 or higher Requirements Privileged access to your Ubuntu System as root or via sudo... Read more
  • 创意诗

  • 螃蟹在剥我的壳,笔记本在写我。 漫天的我落在枫叶上雪花上。 而你在想我。 Read more