How can write a equation fraction in edit text in android studio - math

I want equation fraction like this
I want coding a scientific calculator and use fraction equation.tank you

Related

Script to plot blackbody radiation at different wavelengths

I am trying to create a function that calculates the Planck function, given a wavelength and a specific temperature. Then, I want to plot out the range of wavelengths emitted at temperatures of 290K, 1250K, 1800K, 2600K, 5000K, and 6000K. I am using Studio and I have never plotted this before. I will also need to plot lambda max for each of these temperatures using wien's displacement law. Is there a basic script that I can use to help me plot this? I don't have much experience with R or programming softwares.
I am using Plancks equation to solve

How do I change Data into percentages

I'm very green in using R and programming in general. I want to know how to change numbers from an imported CSV file into percentages and round them into the nearest hundredths. Thanks

How to plot the data I read from a file in R?

Our instructor assigned us with typing a R script. We don't have any study paper or source for the codes that the instructor typed on class so I'm trying to get help from the articles on internet but I still couldn't find a guide for what I need. Please don't get me wrong, I don't request for someone to do my homework I'm just looking for some tips or any guide links that can help me. When I search on google, not all of the results are related to this and they are usually not helping me or too complicated. The assignment is:
Read data from a .txt file. (I researched and learned how to read data but my problem is I don't know which type of data should I type on the text file to make it plottable by average, standart deviation, histogram etc.)
On the first screen, plot the data, plot the average and plot the standart deviation as line
on the second screen, plot a line from corner to corner and sort the values on it
third screen, plot the data as histogram and plot the distribution function on it
4th screen, plot the anomaly and anomaly line = 0, then make the values that are higher than the anomaly line with different pch than the ones that is lower
finally get the png of 4 screens (i found how to do this)
Thanks.
Which type of data?
You should use metric data. For example the height/age of pople.
For example let's assuhe you have a dataframe yourDataframe:
height
160
155
176
153
185
On the first screen, plot the data
You can use R's standard plot function there: lines(yourDataframe$height)
plot the average and plot the standart deviation
There are already function for those things (for example mean(yourDataframe$height)). Just ask Google.
You can add those values to your linechart using points(mean(yourDataframe$height)).
I think after you did this you will be able to solve the rest of your assignment by yourself. R has quite a big community and you will find everything you need by googling. I guess this is how most people learn R.

Animations in SciLab

I want to plot the trajectory of a simple spring mass system using SciLab. I have successfully managed to plot a graph of x vs t. Now I want to make a gif of the trajectory of the body with respect to time (something like this https://www.youtube.com/watch?v=kAl4XATyke4). How am I supposed to go about it? Attached is my progress till now.
//Input the spring constant k, mass m. and the initial values of x and x dot. The code will plot both x (in red) and x dot (in green)
function sol = spingmass(k,m,x_initial,xdot_initial,time)
osqr = k/m;
function dx = f(t,x)
dx(1)=x(2);
dx(2)=-1*osqr*x(1);
endfunction
t = 0:0.1:10;
sol = ode([x_initial;xdot_initial],time,t,f);
clf;
plot(t,sol(1,:),'r');
plot(t,sol(2,:),'g');
//disp(sol);
endfunction
You will be able to build an animated GIF with a series of Scilab snapshots of a graphical figure thanks to the animaGIF toolbox available # https://atoms.scilab.org/toolboxes/animaGIF
It is a standalone toolbox. No dependency like imageMagick or other GIMP is required.
The single animaGIF() function of the toolbox is extensively documented.
The documentation includes some animated GIF figures, moving in the Scilab help browser. Enjoy!

How to write text along a line or curve in R? [duplicate]

This question already has answers here:
How to annotate a reference line at the same angle as the reference line itself?
(4 answers)
Closed 9 years ago.
I have a data-set, and I am trying to fit a linear model using lm(). That part is straight forward.
I can also plot this fit to a graph of the scatter plot using abline( lm( x ~ y ) ).
But now I want to write the parameters of the fit such as adjusted r-squared along the line.
So that if I hover plot different data-sets and their respective fits, I should be able to print some of the values for the fit along the line.
Is it possible to do this in R.
Yes, it's easy to do for straight lines, a curve is trickier, possibly simpler with monospaced fonts. The basic technique would be to just convert your linear equation such that you could derive a polar expression with an angle. Use that angle to set the angle for the text in the text command using the srt argument (from graphic parameters).
For a curve it would be a bit more tricky (perhaps simplified by non-proportional fonts). You need to work out vectors for each letter with an angle and then the width of each character (using strwidth). You'd generate a vector of angles and positions for your characters and loop through them calling text. You need a loop here because text cannot take a vector for the srt argument.

Resources