Posts

Easy Plots in HTML/PHP with Google Charts

Bild
With this function Plots.php it is very easy to make plots in php. You only need to define an array and the parameters you want to show.  PHP/Plots.php at main · PhysIngo/PHP (github.com) Online Code We first generate very easy artificial data like this. We fill a array with time vals and random values and numbers to display different stuff. $newArr = array(); for ($i=0;$i<20;$i++){   $val = 1554241121+60*60*60*$i*$i;   $newArr[$i]["Time"] = gmdate("Y-m-d h:i:s",$val);   $newArr[$i]["Rand"] = 8*sqrt(abs(100*(sin($val))));   $newArr[$i]["Rand2"] = 100*cos(4*$val)*cos($val);      $newArr[$i]["Mean"] = ($newArr[$i]["Rand"]+$newArr[$i]["Rand2"])/2;   $newArr[$i]["Months"] = gmdate("F",$val);   $newArr[$i]["Days"] = gmdate("j",$val);   $newArr[$i]["Days2"] = gmdate("n",$val); } General Settings // general string $paramsname = array("Time","Rand&

Matlab: 3D Coordinate System Rotations with Vectors

Bild
This post describes how to switch/transform between corrdinate systems in Matlab and how this can be represented. There are 3 functions that are crucial here: grid3D(startVec, stopVec, varargin) ... Creates an orthogonal grid in 3D depending on start and end point (diagonal of a cube) and draws ticks, labels and MinorGrids. Rotations can be performed here to show how to transform between Cartesian corrdinate systems. point3D(startVec, stopVec, varargin) ... Is a function to create 3D vectors based on start and end points. It includes options like naming the points, displaying them as arrows, as well as settings for color and thickness. arrow3D(startVec, stopVec, varargin) ... This function creates an arrow in 3D that can be scaled by the options. The functions including example can be downloaded here: Matlab-Functions/CartesianCorrdinateTransformation at main · PhysIngo/Matlab-Functions (github.com) First of all an example where the 1 coordinate system with 2 vectors is rotated 2 times

Vietnam in 3 weeks:

Bild
Vietnam in 3 weeks ( German ) We spent 3 weeks in Vietnam with small backpacks (30 liters) and here we want to share some tips, hints and information about our wonderful vacation :D We divide the post into different categories: 1. visa 2. accommodation 3. our journey 5. meal 6. drinking 7. haggling We started in Hanoi in the north and continued in several stages towards the south. Looking back, we were very satisfied with our route and list the most important things here. 1. Visa: We had already applied for a visa online in advance to save time. So at least our plan. The disillusionment came shortly after landing in Hanoi. The Vietnamese employees at the airport did not care at all, we had to fill out all the paperwork and probably needed in total rather one hour longer because of the communication problems and some ambiguities. Nevertheless we had to pay 25 dollars per person, which was no problem directly at the border. But the staff at the airport was un

Short trip to Krakow (insider hints)

Bild
Our 2 day Krakow trip ( German ) We spontaneously decided to go to Krakow because the Ryanair flight was 24€ back and forth. Because we did not know what to do in Krakau we searched the Internet for all special things we have to consider and what is most important to see. Money: We have heard a lot of times before that Krakow is super cheap but it is also very European so if you go to the touristic places you still pay a lot for meals and so on. Exchange: We have taken for the 2 days 200 zloten (polnish Dollar = 58€) at the Airport but it would have been cheaper if we would have done this in Frankfurt. Transfer: The Transfer from the Airport to the oldtown is quiet cheap (3.8 zloten ~ 1€) and you can buy it also in the busses if you just catch the bus. You don't need any transfers in Krakow because everything is very close there so enjoy the walks along the city. Hostel: Hostels are very cheap! We took the Salve Hostel next to the old town which was 60€ for 2 persons and

Matlab: Point on ellipsoidal surface

Bild
( German ) This post is focussing on the solution of calculating a point of an ellipsoidal surface in dependency of to angles like in spherical coordinates. Mode of operation: This function calculates the closest point on an ellipsoidal surface from an point outside or inside the body in respect to its center. It needs the mesh data of the ellipsoidal body X, Y, Z and the point, where the point with direct connection to the center should be found on the surface. The output parameters are [point, phi, the] = PointOnSurfaceAnalytic(X, Y, Z, x, y, z); the surface point and the angles phi and theta of the ellipsoidal equations. It can be downloaded here .   To derive the formula we start with the ellipsoidal equation: (x/ a)^2 + (y/ b)^2 + (z/ c)^2 = 1   If we consider 𝝋 to be between the x and y axis and  𝝑 be between the y and z axis it leads to: x = y/tan 𝝋   z = y/tan 𝝑   Substitute this in the ellipsoidal equation one gets: (y/( a tan 𝝋))^2 + ( y/ b)^2