Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
  • opengl
  • v0.1
3 results

Target

Select target project
  • repos.tanguy.cavagna/physics/electric-field
1 result
Select Git revision
  • master
  • opengl
  • v0.1
3 results
Show changes
Commits on Source (2)
Showing
with 344 additions and 0 deletions
# LaTeX
_minted-doc/
# LaTeX temporary files
*.aux
*.log
*.toc
*.fls
*.bcf
*.run.xml
# PDF output - usually a bad idea to keep this in Git
*.pdf
# Latexmk
*.fdb_latexmk
# SyncTeX
*.synctex.gz
# LaTeX Beamer
*.snm
*.vrb
*.nav
*.out
# BibTeX
*.bbl
*.blg
bin
.vscode/
\ No newline at end of file
\chapter{Source Code Example}
%\label{chapter:title}
\emph{Adding source code to your report/thesis is supported with the package {\normalfont\texttt{listings}}. An example can be found below. Files can be added using {\normalfont\texttt{\textbackslash lstinputlisting[language=<language>]\{<filename>\}}}.}
\begin{lstlisting}[language=Python]
"""
ISA Calculator: import the function, specify the height and it will return a
list in the following format: [Temperature,Density,Pressure,Speed of Sound].
Note that there is no check to see if the maximum altitude is reached.
"""
import math
g0 = 9.80665
R = 287.0
layer1 = [0, 288.15, 101325.0]
alt = [0,11000,20000,32000,47000,51000,71000,86000]
a = [-.0065,0,.0010,.0028,0,-.0028,-.0020]
def atmosphere(h):
for i in range(0,len(alt)-1):
if h >= alt[i]:
layer0 = layer1[:]
layer1[0] = min(h,alt[i+1])
if a[i] != 0:
layer1[1] = layer0[1] + a[i]*(layer1[0]-layer0[0])
layer1[2] = layer0[2] * (layer1[1]/layer0[1])**(-g0/(a[i]*R))
else:
layer1[2] = layer0[2]*math.exp((-g0/(R*layer1[1]))*(layer1[0]-layer0[0]))
return [layer1[1],layer1[2]/(R*layer1[1]),layer1[2],math.sqrt(1.4*R*layer1[1])]
\end{lstlisting}
doc/figures/campus.jpg

342 KiB

doc/figures/cover-field.png

1.76 MiB

doc/figures/rlc-cover1.jpg

1020 KiB

doc/figures/rlc-cover2.jpg

820 KiB

\begin{titlepage}
\begin{center}
%% Print the title
{\makeatletter
\largetitlestyle\fontsize{45}{45}\selectfont\@title
\makeatother}
%% Print the subtitle
{\makeatletter
\ifdefvoid{\@subtitle}{}{\bigskip\fontsize{20}{20}\selectfont\@subtitle}
\makeatother}
\bigskip
\bigskip
par
\bigskip
\bigskip
%% Print the name of the author
{\makeatletter
\largetitlestyle\fontsize{25}{25}\selectfont\@author
\makeatother}
\bigskip
\bigskip
%% Print table with names and student numbers
\setlength\extrarowheight{2pt}
\begin{tabular}{lc}
Nom de l'étudiant & Numéro d'étudiant \\\midrule
Tanguy & 20868683 \\
\end{tabular}
\vfill
\rule{\textwidth}{1pt}
\raggedright{
Les lignes de champs électrostatique montrent l'impact de partciules chargée dans
un univers discret. Ce raport vise à montrer une possible représentation graphique
de ce phénomène physique ainsi que d'expliquer comment ce résultat a été possible.
En me basant sur les formules, il a été possible de faire cette représentation graphique
en utilisant OpenGL pour plus de flexibilité. Le résultat montre bien l'effet de
partciules charges dans un univers discret et permet d'avoir plusieurs type de représentations
pour plus de précision.
}
\rule{\textwidth}{1pt}
\vfill
%% Print some more information at the bottom
\begin{tabular}{ll}
Instructeur: & Malaspinas Orestis \\
Durée du projet: & 1 mois ? \\
Faculté: & Informatique et Système de Communication, HEPIA
\end{tabular}
\bigskip
\bigskip
%% Add a source and description for the cover and optional attribution for the template
% \begin{tabular}{p{18mm}p{10cm}}
% Couverture: & Entrée principale à HEPIA \\
% \end{tabular}
\end{center}
%% Insert the EPFL logo at the bottom of the page
\begin{tikzpicture}[remember picture, overlay]
\node[above=10mm] at (current page.south) {%
\includegraphics[width=0.35\linewidth]{layout/hepia/logo-black}
};
\end{tikzpicture}
\end{titlepage}
% This template aims to simplify and improve the (Xe)LaTeX template
% provided by HEPIA. Original template by EPFL. Rewritten
% template by Tanguy Cavagna. EPFL adapted template by Batuhan Faik Derinbay.
%
% This template is available under CC BY-NC 4.0. For more information,
% see https://creativecommons.org/licenses/by-nc/4.0/. No attribution
% is required in reports/theses created using this template.
%% Class is based on the default book class and options will be passed
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{layout/hepia-report}[17-04-2022 v1.0 HEPIA Report Class]
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
\ProcessOptions\relax
\LoadClass[10pt,oneside]{book}
%% Main packages in the document --- Some are imported later in the class file
\RequirePackage{mathtools} % Mathematical tools to use with amsmath
\RequirePackage{amssymb} % Extended symbol collection
\RequirePackage{siunitx} % Comprehensive (SI) units package
\RequirePackage{tabularx} % Tabulars with adjustable-width columns
\RequirePackage{booktabs} % Publication quality tables
\RequirePackage{longtable} % Allow tables to flow over page boundaries
\RequirePackage{multirow} % Create tabular cells spanning multiple rows
\RequirePackage{graphicx} % Enhanced support for images
\RequirePackage{float} % Improved interface for floating objects
\RequirePackage[labelfont=bf,justification=centering,footnotesize]{caption} % Captions
\RequirePackage{subcaption} % Support for sub-captions
\RequirePackage{pdfpages} % Include PDF documents
\RequirePackage[pdfusetitle,hidelinks]{hyperref} % Extensive support for hypertext
\RequirePackage[noabbrev,nameinlink,]{cleveref} % Intelligent cross-referencing
\RequirePackage{xcolor} % Driver-independent color extensions
\RequirePackage{tikz} % Create PostScript and PDF graphics
\RequirePackage{xspace} % Define commands that appear not to eat spaces
\RequirePackage{microtype} % Refinements towards typographical perfection
\RequirePackage{geometry} % Customize document dimensions
\RequirePackage{titlesec} % Select alternative section titles
\RequirePackage{titletoc} % Alternative headings for toc
\RequirePackage{fancyhdr} % Control of page headers and footers
\RequirePackage{enumitem} % Control layout of itemize, enumerate, description
\RequirePackage{etoolbox} % Toolbox of programming facilities
\RequirePackage{iftex} % Adds if-else statements to support multiple compilers
\RequirePackage{datetime} % Change format of \today
%% Defining commands for the cover image, subtitle, subject, affiliation and table of authors
\newcommand*\subtitle[1]{\def\@subtitle{#1}}
\newcommand*\subject[1]{\def\@subject{#1}}
\newcommand*\affiliation[1]{\def\@affiliation{#1}}
\newcommand*\coverimage[1]{\def\@coverimage{#1}}
\newcommand*\covertable[1]{\def\@covertable{#1}}
%% Scaling the margins to be slightly smaller than default (.7)
\geometry{a4paper,hscale=0.75,vscale=0.8}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% I. Loading the fonts %%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifPDFTeX
%% pdfLaTeX is available for compatibility and uses a Paletino-like font
\RequirePackage[T1]{fontenc} % Selecting T1 font encoding
\RequirePackage{newpxtext} % Palatino-like font...
\RequirePackage{newpxmath} % ...with support for mathematics
%% Another font can be used as the large title style font if desired
\def\largetitlestyle{\normalfont}
%% Warning when using pdfLaTeX
\@latex@warning@no@line{You are using pdfLaTeX as the compiler. You can safely ignore this warning or consider changing the compiler to XeLaTeX or LuaLaTeX to adhere to the EPFL house style.}
\else
%% If XeLaTeX or LuaLaTeX is set as the compiler, the EPFL house style fonts are used
\RequirePackage{fontspec} % Advanced font selection
\newfontfamily{\suisseintl}{SuisseIntl}
[Path=layout/hepia/fonts/suisse-intl/,
Extension=.ttf,
UprightFont=*-Regular,
BoldFont=*-Bold,
ItalicFont=*-RegularItalic]
%% Adding Arial as the main font and EPFL Ultralight and Georgia as supplementary fonts
\setmainfont{Arimo}
\setmathsf{Arimo}
\setmathtt{Arimo}
\newfontfamily\largetitlestyle[Path=layout/hepia/fonts/suisse-intl/]{SuisseIntl-SemiBold.ttf}
\newfontfamily\subtitlestyle[Path=layout/hepia/fonts/suisse-intl/]{SuisseIntl-Thin.ttf}
\newfontfamily\subjectstyle[Path=layout/hepia/fonts/suisse-intl/]{SuisseIntl-Regular.ttf}
\newfontfamily\quotefont[Path=layout/hepia/fonts/suisse-intl-mono/]{SuisseIntlMono-Regular.ttf}
%% Changing the quote environment to use Georgia
\AtBeginEnvironment{quote}{\quotefont}
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% II. Adjusting the layout of the titles in the text and table of contents %%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Formatting chapter titles and spacing
\titleformat{\chapter}[display]
{\flushright}
{\fontsize{96}{96}\selectfont\largetitlestyle\thechapter}
{0pt}
{\Huge}
\titlespacing*{\chapter}{0pt}{0pt}{2\baselineskip}
%% Formatting section titles and spacing
\titleformat{\section}
{\Large\bfseries}
{\thesection.}
{5pt}
{}
\titlespacing*{\section}{0pt}{\baselineskip}{0pt}
%% Formatting subsections titles and spacing
\titleformat{\subsection}
{\large\bfseries}
{\thesubsection.}
{5pt}
{}
\titlespacing*{\subsection}{0pt}{\baselineskip}{0pt}
%% Formatting subsubsections titles and spacing
\titleformat{\subsubsection}
{\bfseries}
{}
{0pt}
{}
\titlespacing*{\subsubsection}{0pt}{\bigskipamount}{0pt}
%% Reducing the vertical white space between chapters in the table of contents
\dottedcontents{chapter}[1.5em]{\vspace{0.5\baselineskip}\bfseries}{1.5em}{0pc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% III. Adjusting the header and footer %%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Change the header and footer of pages where chapters do not start (depends on twoside option)
\if@twoside
\fancyhf{}
\fancyhead[LE,RO]{\thepage}
\fancyhead[RE]{\nouppercase{\leftmark}}
\fancyhead[LO]{\nouppercase{\rightmark}}
\RequirePackage{emptypage} % Remove header and footer on empty pages
\else
\fancyhf{}
\fancyhead[R]{\thepage}
\fancyhead[L]{\nouppercase{\rightmark}}
\fi
\pagestyle{fancy} % Setting the package defaults and the additional changes as the style
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% IV. Creating the cover page %%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand*\makecover{
%% Use the Tikz library positioning and clear the page header and footer
\usetikzlibrary{positioning}
\thispagestyle{empty}
%% Constructing the cover page (cover image, name of university, logo and title text respectively)
\begin{tikzpicture}[overlay,remember picture]
\node[above=0,inner sep=0] at (current page.south) {\includegraphics[width=\paperwidth]{\@coverimage}};
\node[rotate=0, above right=1.8mm and 7mm] at (current page.south west)
{\ifdefvoid{\@affiliation}{}{\fontsize{8.1}{9.72}\selectfont\color{white}\@affiliation}};
\node[above right=10mm] at (current page.south west) {%
\includegraphics[width=0.35\linewidth]{layout/hepia/logo-white.png}};
\node[below=2cm,fill=black!80,minimum width={\paperwidth},inner ysep=25pt,opacity=0.4,text opacity=1] at (current page.north) {%
\begin{minipage}{0.9\paperwidth}
\largetitlestyle\fontsize{50}{50}\selectfont\color{title}\@title \\[0.5ex]
\color{white}\normalfont\fontsize{22}{22}\selectfont%
\subtitlestyle\ifdefvoid{\@subtitle}{}{\@subtitle \\[2.5ex]}%
\subjectstyle\ifdefvoid{\@subject}{}{\@subject \\[0.5ex]}
\subtitlestyle\fontsize{20}{24}\selectfont\ifdefvoid{\@covertable}{\@author}{\@covertable}
\end{minipage}};
\end{tikzpicture}
\newpage
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% V. Setting up listings %%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{listings} % Typeset source code listings
\lstset{
basicstyle=\ttfamily\footnotesize, % Style of the font that is used for the code
backgroundcolor=\color{gray!10}, % Background color
keywordstyle=\color{red!75!black}, % Keyword style
stringstyle=\color{green!40!black}, % String style
commentstyle=\color{blue!30!black}, % Comment style
numbers=left, % Add line numbers on the left side
numbersep=5pt, % Decrease distance between line numbers and code
numberstyle=\tiny, % Line number style
breaklines=true, % Line break automatically
}
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added