Tumgik
#Exact Value of sin(pi-x)
sstonki · 2 years
Text
Exponential graph equation maker
Tumblr media
Note that the first function is sin(a*x). You can also enter an exact value into the box at the top of the slider, followed by the GRAPH button or the Enter key.įor example, in the chart above, press 'reset'. When you enter your equations, you can refer to up to four variables that are controlled by sliders.Īnd you can adjust the value of each variable by moving the slider up or down. However, if you change the axis limits, this may no longer be true. The initial range of values on the x and y axes are in the same ratio, so a graph of y = x will be at 45°,Īnd circles would be round, not squashed into ellipses. The aspect ratio (ratio of width to height) of the graph window is exactly 4:3. GFE will check to ensure that the lower value is at the bottom of the y axis or the left of the x-axis. To change them, simply edit them in place and press GRAPH or the Enter key again. If you enter a value that is off the graph, the cursor will not show,īut the values of the functions for that x value will be displayed correctly.Īt each end of the x and y axis is a box containing the end values. You can enter the x value for the cursor manually into the text box in the upper left.Īfter entering a value press "Graph" or the enter key. It shows the values of each function where the cursor intersects that function. If you click on "show cursor", a thin vertical line appears. If left unchecked, each function is shaded in a different color. This allows you to more easily see where complex functions overlap, since the more overlap there is, the darker the shading. If this is checked, the shaded areas for all three functions are all the same light gray. When plotting inequalities, the "monochrome shading" checkbox can be used. The area of the graph where y is greater than the function value is shaded. The function will be plotted as a line as usual. GFE can be used to plot inequalities by changing the relational operator in the pull-down menu to the left of the function. It is best to always enter the correct expression yourself. It will add two extra closing parentheses so they balance and evaluate it as 2+(sin(x)) Note: This may not always produce the desired result. When you press GRAPH or enter, it will automatically add enough closing parentheses to balance them. You may have meant it as one over 2sin(x). Since there are no parentheses, it is executed from left to right so it sees it as one half of sin(x). For example if you enter 1/2sin(x) GFE inserts a multiply between the 2 and the sin. It will not work if the function is preceded by a variable name. For exampleģcos(2.1) will be automatically treated as if you entered 3*cos(2.1): three times the cosine of 2.1. If a function (such as sin() ) is preceded by a number, GFE assumes you want to multiply them. See PI definition for more.įor example you could enter sin(pi) or e^2.1 There are two constants you can refer to. Returns the smallest integer greater than or equal to x Returns the highest integer less than or equal to x Returns x rounded off to the nearest whole number Returns the absolute value of x (always positive or zero) The power to which you must raise e to get x.Į (approx 2.718) raised to the power of x. The power to which you must raise the 10 to get x. The trigonometry cotangent function, x in radians. The trigonometry cosecant function, x in radians. The trigonometry secant function, x in radians. The trigonometry tangent function, x in radians. The trigonometry cosine function, x in radians. The trigonometry sine function, x in radians. The function names are not case sensitive.Īll trigonometric functions operate in radians. GFE has the following built-in functions.
Tumblr media
0 notes
testblogplzignore · 3 years
Text
k
Fuck it doing it by hand so I can see it better. This is light years slower than just writing it down but I get the advantage of having it on the computer
\( u(x) = \frac{T_2 - T_1}{h} x + T_1 \)
\( w(x,0) = f(x) - u(x) \)
\( f(x) = \delta ( h) \)
\( w(x,0) = \delta (h) - \big( \frac{T_2 - T_1}{h} x + T_1  \big) \)
\( w(x,0) = \delta (h) +  \frac{T_1 - T_2}{h} x - T_1  \)
\( w(x,0) =  \sum_{n=1}^{\infty} c_n sin \big( \frac{n \pi x}{h} \big) \)
\( \delta (h) + \frac{T_1 - T_2}{h} x - T_1 = \sum_{n=1}^{\infty} c_n sin \big( \frac{n \pi x}{h} \big) \)
\( c_n = \frac{2}{h} \int_{0}^{h}\Big[  \delta (h) + \frac{T_1 - T_2}{h} x - T_1 \Big] sin \big( \frac{n \pi x}{h} \big)dx \)    
\( c_n = \frac{2}{h} \Big[ \int_{0}^{h}\ \delta (h) sin \big( \frac{n \pi x}{h} \big)dx + \int_{0}^{h}\ \frac{T_1 - T_2}{h} x sin \big( \frac{n \pi x}{h} \big)dx - \int_{0}^{h}\ T_1 sin \big( \frac{n \pi x}{h} \big)dx \Big]  \)    
\( c_n = \frac{2}{h} \Big[ \int_{0}^{h}\ \delta (h) sin \big( \frac{n \pi x}{h} \big)dx + \frac{T_1 - T_2}{h} \int_{0}^{h}\ x sin \big( \frac{n \pi x}{h} \big)dx - T_1 \int_{0}^{h}\ sin \big( \frac{n \pi x}{h} \big)dx \Big]  \)  
\( \int_{0}^{h}\ \delta (h) sin \big( \frac{n \pi x}{h} \big)dx = 0 \)
with a couple steps
huh
why does the dirac delta always disappear as an initial condition
actually this makes sense because you want \( w(x,0) = -u(x)\) transient solution only so when \( T(x,0) = w(x,0) + u(x) \) you get
\( T(x,0) = f(x) -u(x) + u(x) = f(x) \)
\( \frac{T_1 - T_2}{h} \int_{0}^{h}\ x sin \big( \frac{n \pi x}{h} \big)dx = \frac{T_1 - T_2}{h} \frac{ h^2}{n^2 \pi^2} \Big[  sin \big( \frac{n \pi x}{h} \big) - \frac{ h}{n \pi}  x cos \big( \frac{n \pi x}{h} \big) \Big]_0^h \)
\( \frac{T_1 - T_2}{h} \int_{0}^{h}\ x sin \big( \frac{n \pi x}{h} \big)dx = \frac{T_1 - T_2}{h} \frac{ h^2}{n^2 \pi^2} \Big[ - \frac{ h^2}{n \pi}  \Big] \)
\( \frac{T_1 - T_2}{h} \int_{0}^{h}\ x sin \big( \frac{n \pi x}{h} \big)dx = (T_2 - T_1) \frac{h^3}{n^3 \pi^3} \)
\( T_1 \int_{0}^{h}\ sin \big( \frac{n \pi x}{h} \big)dx = - T_1 \frac{h}{n \pi } \)
\( c_n = \frac{2}{h} \Big[ 0 + (T_2 - T_1) \frac{h^3}{n^3 \pi^3} - - T_1 \frac{h}{n \pi } \Big]  \)  
\( c_n = \frac{2}{h} \Big[ (T_2 - T_1) \frac{h^3}{n^3 \pi^3} +T_1 \frac{h}{n \pi } \Big]  \)  
I ain’t seeing how that cancels at t=0 maybe with the sin?
it should solve the boundary values
but
\( T(x,t) = w(x,t) + u(x) \)
\( T(x,t) =  \sum_{n=1}^{\infty} c_n sin \big( \frac{n \pi x}{h} \big) e^{\beta \Big( \frac{n \pi}{h} \Big)^2 t}     +  \frac{T_2-T_1}{h} x + T_1  \)
\( T(x,t) =  \sum_{n=1}^{\infty} \frac{2}{h} \Big[ (T_2 - T_1) \frac{h^3}{n^3 \pi^3} +T_1 \frac{h}{n \pi } \Big] sin \big( \frac{n \pi x}{h} \big) e^{\beta \Big( \frac{n \pi}{h} \Big)^2 t}     +  \frac{T_2-T_1}{h} x + T_1  \)
\( n=1\)
\( T(x,t)_{n=1} =  \frac{2}{h} \Big[ (T_2 - T_1) \frac{h^3}{1^3 \pi^3} +T_1 \frac{h}{1 \pi } \Big] sin \big( \frac{1 \pi x}{h} \big) e^{\beta \Big( \frac{1 \pi}{h} \Big)^2 t}     +  \frac{T_2-T_1}{h} x + T_1  \)
\( T(x,t)_{n=1} = \frac{2}{h} \Big[ (T_2 - T_1) \frac{h^3}{ \pi^3} +T_1 \frac{h}{ \pi } \Big] sin \big( \frac{ \pi x}{h} \big) e^{\beta \Big( \frac{ \pi}{h} \Big)^2 t}     +  \frac{T_2-T_1}{h} x + T_1  \)
\( T(x,0)_{n=1} = \frac{2}{h} \Big[ (T_2 - T_1) \frac{h^3}{ \pi^3} +T_1 \frac{h}{ \pi } \Big] sin \big( \frac{ \pi x}{h} \big)  +  \frac{T_2-T_1}{h} x + T_1 \)
try \( x=0.5 \) in a program as \( h > 0.5 \)
k that didn’t go well
by thinking not like an idiot just check \( T_2 \) and see
What I don’t understand is why it’s not cancelling off
it should be
So the fallacy with this case is that it’s the first term in the series and other terms may cancel it off
the answer for \( T_2 \) is very close to just being \(T_2\) which is what it’s supposed to be
Tumblr media
small wiggle from \( T_2 \) with \( h=1\)
at least it lines up with it at \( x=n \) or \( x=h\) if I didn’t set \( h=1\)
What I’ve learned from this is the sinusoidal/exponential part to a scenario with fixed temperatures (I assume this is why it’s not working but I’m stupid) never has that part of the equation touch it. This is clearly to fix the temperatures. Gonna give up on this and find something with varying temperatures. It occurs to me that the reason it’s this simplified to fixed temperatures at the boundaries is because PDE’s are legitimately retarded to solve by hand as per one of the points to the class. Because of this I might not be able to derive an equation for a simplified scenario unless I try something different.
The coffee cup cooling assuming the temperatures at the ends don’t change looks like the reverse of this with the large wave spike coming from the cold side
Tumblr media
I am apparently not applying my brain enough
I wanted math to show that this is the exact math for heat’s travel as you cool it down. Not that math is legible for the people who read my posts. In short I’ll still make a post about it and simply it largely down to because heat travels in waves there is an exponential term that dominates at very small times so for a small amount of time it travels very quickly assuming a temperature difference then slows as it gets cooler and cooler. I already knew this but I wanted to mathematically show it
I was also going to put a temperature on the delta term if it worked out. Like a physicist I am well aware it was supposed to be there
0 notes
scifigeneration · 7 years
Text
Pi pops up where you don't expect it
by Lorenzo Sadun
Tumblr media
Pi is at the center of all circles. Holger Motzkau, CC BY-SA
Happy Pi Day, where we celebrate the world’s most famous number. The exact value of π=3.14159… has fascinated people since ancient times, and mathematicians have computed trillions of digits. But why do we care? Would it actually matter if somebody got the 11,137,423,895,285th digit wrong?
Probably not. The world would keep on turning (with a circumference of 2πr). What matters about π isn’t so much the actual value as the idea, and the fact that π seems to crop up in lots of unexpected places.
Let’s start with the expected places. If a circle has radius r, then the circumference is 2πr. So if a circle has radius of one foot, and you walk around the circle in one-foot steps, then it will take you 2π = 6.28319… steps to go all the way around. Six steps isn’t nearly enough, and after seven you will have overshot. And since the value of π is irrational, no multiple of the circumference will be an even number of steps. No matter how many times you take a one-foot step, you’ll never come back exactly to your starting point.
Tumblr media
Calculating the area of a circle with wedges. Jim.belk
From the circumference of a circle we get the area. Cut a pizza into an even number of slices, alternately colored yellow and blue. Lay all the blue slices pointing up, and all the yellow slices pointing down. Since each color accounts for half the circumference of the circle, the result is approximately a strip of height r and width πr, or area πr2. The more slices we have, the better the approximation is, so the exact area must be exactly πr2.
Pi in other places
You don’t just get π in circular motion. You get π in any oscillation. When a mass bobs on a spring, or a pendulum swings back and forth, the position behaves just like one coordinate of a particle going around a circle.
youtube
Simple harmonic motion is another view of circular motion.
If your maximum displacement is one meter and your maximum speed is one meter/second, it’s just like going around a circle of radius one meter at one meter/second, and your period of oscillation will be exactly 2π seconds.
Tumblr media
The area of the space under the normal-distribution curve is the square root of pi. Autopilot, CC BY-SA
Pi also crops up in probability. The function f(x)=e-x², where e=2.71828… is Euler’s number, describes the most common probability distribution seen in the real world, governing everything from SAT scores to locations of darts thrown at a target. The area under this curve is exactly the square root of π.
How did π get into it?! The two-dimensional function f(x)f(y) stays the same if you rotate the coordinate axes. Round things relate to circles, and circles involve π.
Another place we see π is in the calendar. A normal 365-day year is just over 10,000,000π seconds. Does that have something to do with the Earth going around the sun in a nearly circular orbit? Actually, no. It’s just coincidence, thanks to our arbitrarily dividing each day into 24 hours, each hour into 60 minutes, and each minute into 60 seconds.
What’s not coincidence is how the length of the day varies with the seasons. If you plot the hours of daylight as a function of the date, starting at next week’s equinox, you get the same sine curve that describes the position of a pendulum or one coordinate of circular motion.
Advanced appearances of π
More examples of π come up in calculus, especially in infinite series like 1 - (1⁄3) + (1⁄5) - (1⁄7) + (1⁄9) + ⋯ = π/4 and 12 + (1⁄2)2 + (1⁄3)2 + (1⁄4)2 + (1⁄5)2 + ⋯ = π2/6 (The first comes from the Taylor series of the arctangent of 1, and the second from the Fourier series of a sawtooth function.)
Also from calculus comes Euler’s mysterious equation eiπ + 1 = 0 relating the five most important numbers in mathematics: 0, 1, i, π, and e, where i is the (imaginary!) square root of -1.
Tumblr media
A graph of the exponential function y=e^x. Peter John Acklam, CC BY-SA
At first this looks like nonsense. How can you possibly take a number like e to an imaginary power?! Stay with me. The rate of change of the exponential function f(x)=ex is equal to the value of the function itself. To the left of the figure, where the function is small, it’s barely changing. To the right, where the function is big, it’s changing rapidly. Likewise, the rate of change of any function of the form f(x)=eax is proportional to eax.
Tumblr media
The relationship between an angle, its sine, cosine and a circle. 345Kai, CC BY-SA
We can then define f(x)= eix to be a complex function whose rate of change is i times the function itself, and whose value at 0 is 1. This turns out to be a combination of the trigonometric functions that describe circular motion, namely cos(x) + i sin(x). Since going a distance π takes you halfway around the unit circle, cos(π)=-1 and sin(π)=0, so eiπ=-1.
Tumblr media
Finally, some people prefer to work with τ=2π=6.28… instead of π. Since going a distance 2π takes you all the way around the circle, they would write that eiτ = +1. If you find that confusing, take a few months to think about it. Then you can celebrate June 28 by baking two pies.
Lorenzo Sadun is Professor of Mathematics at the University of Texas at Austin
This article was originally published on The Conversation. 
15 notes · View notes
Text
Some Irresistible Integrals, Computed Using Statistical Concepts
#ICYDK: Below are a few integrals that you won't find in textbooks. Solving them is a good exercise for college students with some advanced calculus training. We provide the solution, as well as a general framework to compute many similar integrals. Maybe this material should be part of the standard math curriculum. Here, p, q, r are positive real numbers, with q larger than p.  The Gamma symbol represents the gamma function. It is possible that these results are published here for the first time. These are known as Frullani integrals, although the ones mentioned here are not covered by Frullani's theorem, nor any recent generalization that I am aware of. Indeed, AI-based automated integration platforms such as WolframAlpha can not find the exact value (only an approximation) while they are able to compute standard Frullani integrals exactly. My approach to derive the exact values is different from the classical approaches, as it relies on the statistical concept of expectation, possibly leading to interesting areas of research. How to compute such integrals? These integrals are a particular case of the following main result, proved in the next section: where g(x) / x tends to 1 as x tends to infinity, and f is a bounded function with a finite expectation. Some additional conditions may be required, for instance the fact that there is no singularity point in the above quotient, and that g(x) has a lower bound that is strictly positive. The expectation of f, also called average value, is defined as For instance, if f(x) = sin(SQRT(x)), then the expectation exists, and it is equal to E(f) = 2 / Pi. (Prove it!) The main result introduced at the beginning of this section, is rather intuitive but needs great care to prove it rigorously, including correctly stating the required assumptions on f and g to make it valid. Some cases might require working with non-Riemann integrals. Here we only provide the intuitive explanation. Proof of the main result (sketch) Here p, q and n are integers, with q greater than p. We are interested in the case where n tends to infinity. We approximate integrals using the Euler-Maclaurin summation formula. The approximations below become equalities as n tends to infinity. We used the classic approximation of the harmonic series to make the logarithm terms appear. Note that for large values of k, g(k) is asymptotically equal to k. This was one of the requirements for the formula to be valid.  We also have: Using the change of variable y = x / q in the first integral, and y = x / p in the second integral, we obtain: Let us remark that: * q / g(qy) is asymptotically equivalent to 1 / y (for large values of y) * p / g(py) is asymptotically equivalent to 1 / y * both integrals diverge, so the impact of small values of y eventually vanishes in each integral separately * the difference between the two integrals converges In view of this, we have: This concludes the proof. Related Problems * Four Interesting Math Problems * Curious Mathematical Problem * Two Beautiful Mathematical Results - Part 2 * Two Beautiful Mathematical Results * Number Theory: Nice Generalization of the Waring Conjecture * Yet Another Interesting Math Problem - The Collatz Conjecture To not miss this type of content in the future, subscribe to our newsletter. For related articles from the same author, click here or visit www.VincentGranville.com. Follow me on on LinkedIn, or visit my old web page here. DSC Resources * Book and Resources for DSC Members * Comprehensive Repository of Data Science and ML Resources * Advanced Machine Learning with Basic Excel * Difference between ML, Data Science, AI, Deep Learning, and Statistics * Selected Business Analytics, Data Science and ML articles * Hire a Data Scientist | Search DSC | Find a Job * Post a Blog | Forum Questions https://goo.gl/RXZFDe
0 notes
mathematicianadda · 4 years
Text
Simplify $\tan^{-1} ( \frac{x-\sqrt{1-x^2}}{x+\sqrt{1-x^2}} )$ with trigonometric substitution https://ift.tt/eA8V8J
I will explain my approach, help me with the last step please! $$ \tan^{-1} {\left(\frac {x - \sqrt {1-x^2}}{x + \sqrt {1-x^2}}\right)}$$
substituting x = $\sin \theta$ (as learnt from book) and solving 1-$\sin^2 \theta$ = $\cos^2 \theta$ $$ \tan^{-1} {\left(\frac {\sin \theta - |\cos \theta|}{\sin \theta + |\cos \theta| }\right)}$$
For solving modulus, it was important to determine range of $\theta$ , therefore I defined it (as it is my variable,i can define it my way) for [-$\pi$/2 , $\pi$/2] so that sine covers all values from $-1$ to $1$ (as , $ -1 \le x \le 1 \,$ , from domain ) and $\cos \theta$ is positive , and hence $|\cos \theta| = \cos \theta$.
$$ \tan^{-1} {\left(\frac {\sin \theta - \cos \theta}{\sin \theta + \cos \theta }\right)}$$ = dividing by $\cos \theta$ $$ \tan^{-1} {\left(\frac {\tan \theta - 1}{\tan\theta + 1 }\right)}$$
= by formula of $\tan (\theta - \pi/4)$ $$ \tan^{-1}( \tan{\left(\theta - \pi/4\right)})$$
That's where I am stuck ,as according to the identity,$\quad$ $tan^{-1} ( \tan \alpha) = \alpha$ $\quad$ only when $\, -\pi/2 <\alpha < \pi/2$ . But here $$ -3\pi/4 \le \,(\theta-\pi/4) \, \le \pi/4 $$ Therefore, I am not going to get ($ \,\theta - \pi/4 $) out of the expression. What i get will be based on that graph of $\bf {\tan^{-1} (\tan x)}$ . $$ (\theta - \pi/4) +\pi \,$$ for $\,-3\pi/4 \le \, (\theta -\pi/4) \, < -\pi/2 \,\,$ and
$$\theta -\pi/4$$ for $\,-\pi/2 < \, (\theta -\pi/4) \, \le \pi/4 \,\,$
My teacher just cancelled arctan and tan and wrote $\theta - \pi/4$ and he didn't even include that modulus function over $\cos \theta$.
So what will be the exact answer because if everyone decide $\theta$ as per they like then there will not be a finite answer. Everyone will have their own answers and in each answer they have multiple cases as I just discussed above.
So please help me, very hopefully I signed up in stackexchange!
Found Solution :-
I was confused because I was thinking that there can be many solutions differing person to person, but even if you choose any value of $\theta$ , you are going to get two solutions which are in the asked question above. The problem resolves when we write $\theta$ in terms of $sin^{-1} x$ as then we would not simply write like $$ \theta = \sin^{-1} x $$ we would write an equation,$$ \sin^{-1} x = \sin^{-1} (\sin \theta)$$, now if $\theta$ is not in range of $-\pi/2$ and $\,\pi/2$ , then there would be some constant in $\pi$ (like , $\pi/4 , 2\pi$ etc. we would have to add or subtract according to the graph of 'sin inverse sin' and when we would put that value of $\theta$ , we would end with the solutions as answered by people. (I write the answer in this edit to help anyone who will reach here after searching web , thanks to everyone for answers)
from Hot Weekly Questions - Mathematics Stack Exchange Aryaman from Blogger https://ift.tt/32uV1PE
0 notes
top1course · 5 years
Text
How To Sell Millions Without Ever Opening Your Mouth! Copywriting Secrets Simple 7-Step Formula Pt.1
youtube
Is it possible to sell millions of dollars without opening your mouth, well is he by the end of this, video I’m going to prove to you, yes is very, possible today we are going to talk about cooperating, secrets I have gave joining me, am I, cole director of social media, and gave manages all might, all my social media especially YouTube, so if you see that how I’m blowing up on YouTube how we went from, in the beginning of this year, with 100000 subscribers now almost the end, office year we’re going to hit a million Subs, subscribers, 10 x growth, is because, the gates help, okay so, he is going to act as almost as an audience or entering me on Sundays covered in question, i’ve been doing this for a long long time so sometimes the concepts, the preceptor I know that it’s, soul, so be with me for so long as I can conscious competent but maybe gave for him it’s a, Copper dick is a new thing for you right, is a new world, he will almost asked questions on your, behalf, now before I go into the, 7 step, on how to create, gray coffee, let’s just defy what cop rating, because I believe most people they could confuse what comprehend, you think copywriting, he’s about, writing, right and we hear I hear this a lot, odana I’m not a writer, my English is not, or I am not very, creative, what is not a, copywriting, what about closing, the way I Define carpeting is, closing in, print, okay closing in print or, closing the introvert right you can close using instead of using your, spoken words, you’re using your written words, imprint, to persuade convince and employing someone, want to make a Vine perch, do do a move to to do a make a decision whatever it might be what a goal that you might have, That’s all that all cooperating is, so if it’s closing you means it is about communication, it’s not about writing, right it’s not about, so don’t be intimidated by the whole concept of, writing cuz I flunked English twice when I was, in high school, but it doesn’t stop me from creating coffee, does May, millions and millions of dollars, deep Eddy questions, so I would say I see a lot in the YouTube comment where people they don’t really, noah copywriting is and how to, pi, and how, actually the origins of copywriting how, for any design or anything part of the business at all goes down to, word of mouth and being spoken and being read, correct, so how would someone I would, say how would they, Shift their thinking to start from a.
Perspective of their user, and the person you’re trying to reach through, i want you to think about cooperating good sometimes people might think it does that mean it is, that words are on the web page, it’s not that, every email that you sent out, is copywriting, are free, what pace are you create that’s corporate, baby social media post, cooperating, are free, even a video, write a video script a video, absl like a video sales letter, operating, infomercial that you, you see that’s copyrighted, so is everything that’s involved with, closing on a very massive, scale, on a mass scale to be. Copper, so you think about, a lot of entrepreneurs and business owners about that, you can hide copyright or you can also ask operator, but the biggest sin when it comes to businesses, you don’t have any understanding of what corporate is, Because that’s what most profit, this one sells appliance service, you can have exactly the same product, but the way that you write you communicate your tickling your marketing message, one, one message could produce $10,000, the exact same, product with a different message, you could create a million-dollar, i always think of this I will let me give you a metaphor, think of it as a, us, dollar bill, okay a dollar bill, the difference between a $1 bill, and $100 bill value, is the message that’s on, the piece of paper, well I want you to do in life, just why sometimes when you understand copywriting I’m not saying you have to be a master copywriter but by having some basic understanding, you can make some small changes may be the subject line, maybe the headline maybe to call to action, with a c LaMotta effort to see my money the same amount of traffic, Southern me now you getting to three times more results, we see this a lot of social media with everything, we were the same thing but we change the message we change the subject line, some minor tweaks, dollywood getting way more results right I wouldn’t be scared to, testing because we do that a lot. Encourages 100% and don’t be afraid to test, 100% guys test, and it is not about, the eagle where I know what works best if you don’t know I still don’t know, right just because I’ve experienced but sometimes you also make certain assumptions about certain things, and that’s a great thing now about the internet, doctor when I was doing carburetor, what do we like to recommend, right licking the envelope putting the stand, so we will send all this say, to a list, a5000 Direct Mail, Letters, good old like paper and print, and then 5002 this list, 5002 Dallas, and we’ll see what kind of response we get, it would take like weeks and months before we know the results, but now it’s internet, with tracking with software, you know exactly what’s happening so much, easier, so, pod up, being a good, copyright, it’s snowing., you and I will not the marketing genius, customer, let them, how you, if the offer, one good thing that I’ve learned from you see who is sometimes we look at what, even you guys Post in the comment and will reverse-engineer that, intoarce, girls page into, if you are not so sure about how how do I get started with this Incorporated, into my business, i’ll give you a very powerful but simple strategy, set up a time to talk to some of your best, okay and you actually talk to them, You can get them a little smoke if it’s a.
I’m just doing some research about my company, i want to do some marketing can pay you your my best and most loyal customer, can I have, 30 minutes, and if they do you can get them some morphe, certificate, starbucks whatever it is doesn’t matter what it is, and you talk, and you ask him questions like hey, you look before you, you do business with, company, what was your problem, right why did you choose us, and why do you stay with, they would tell you all these things, and which one of you want to record it ask for the commission you record it, and this is so easy, you take what they say, and you turn it into, coffee, so let’s say, give me example give me an example of something that people, alternate so let’s say, Yeah like, i can’t find any leads to my clients, and I’m really struggling finding leads and customers I go to these conference, and I talk to other people but none of them that really follow, oh okay so, leads all that so exactly that’s a pain that they have less a yellow product to solve their problem, easley, he’s the light. Could be a potential hotline, it could you want to call I get one of those, benefits team in a bullet point, how to quickly and easily generate more leads for your business without going to these, networking, boom right there you have, how to cook a medium talking about exactly what they say and it turned it into your copy, you do that for a number of customers song you are good, to go, see how easy this is not as complex as you think, right they would tell you your, Your customers they want to buy from you, but what do you want to know is the assurance that you know what, are going through, they want the shoes that, you’ll probably service can help himself., number one, look at 3 I want to teach you, 7 steps that you can take, every single time you buy coffee, you go through these steps, i Promise You by the end of the seven steps, you’ll coffee would be so much more powerful so much more compelling, . one and that is, identify your ideal, this is the most important part, because most people when did Duke operating I used to make this mistake, you so excited, you get you could tell it on the computer and you stopped typing, no you do not do that, you need to First understand truly understand, who your ideal customers, now that the way that is fine I do customers, Is three things, number one your ideal customer, they have a need, volume, so if I am a vegan, if you try to sell me steaks, we got a problem here right, you got to sell stick to a stick lighter so I should have a meeting at 1 for your part at this number one, number 2 is IHOP the ability, biopod, so I want it but also I could pay for, and number three if I have the authority, dubai Abaya service, so if, i am selling something to this a husband and wife, and I’m only talking to husband but we leased a wife that makes it, decision, that is not good, so it’s, they have their Nita want they have their building at the store if that’s the ideal customer, now once you know this, who do custom is even Facebook, This so much.
Targeting that we can do nowadays, with, he could be your interest it could be, gucci belong to it could be your age, ditto, hundreds of variations hundreds of, reference point hundred things you can do to Target, what you know exactly who you talkin bout that is, now you go, talk to them in your copy, one-on-one like this, and that’s what you do, i believe, good copy, 80% of research, and 20% lighting, so if Andrea Spinelli a month, sometimes sometimes 3 weeks a month, working on, coffee walk away campaign, you should spend like 2-3 weeks just in, before you write a single, you should have a very clear idea, exactly what the offer is, all these things, before you, i think another helpful tip, tipsy food that you gave the other day was, you really want to think about, who that ideal customer is in that, Customer profile and really Envision you talking to them one-on-one, like if you were just sitting down talking to them casual, don’t try to use very big mumbo jumbo, words just casual conversation as if, if you’re really trying, talk with them you want to talk to him on a one-on-one basis right you don’t want to be like right now I’m communicating with, with you, at any given time, your reader, audience, oil plus, they are, reading your coffee, the off, watching a video, by themselves, usual Toyota 101 connection, so I’m talking to you, i’m not talking like, speaking to a thousand a million people I’m not talking to groups, that public speaking is, completely different, what way comes to coffee, you want to be very personal I want to be like, one on one, assuming now you know your customer and I could tell you the amount of money you make is indirect, Proportion to how well you understand your car, i’ll say that one more time, the amount of money you make, it indirect proportion, 2 how well you understand, you know this business to fail, that, be entrepreneurs the business owner if they have this idea, on this widget I have this adventure time I am so excited about it, they go they take it to the market place nobody gets, because they don’t understand their, ideal, costume, it’s not enough to say hey my mom likes it my wife likes, did you say, when people typically say while everybody is my ideal cussed, i want to sell to every the white there is a bigamist, he kanaka even company ice Vegas Apple, even a couple days because she likes a Walmart that serves, everyone is my costume, no, yep Walmart, right you have so many your target, They all have different demographics so you know one could say that everyone is, especially for like small business are you mija medium-sized business you got to think you got to narrow it down, very much narrow down because the more you can narrow down the more personal, you can make it message, in Dominion, one of the best reactions you could get and I love this one man to Allen, he said let’s say you have an idea you can offer you want to test it out is that it is, you hang out with your target market, can you bring your offer and you show it to them, do you know what checkout is at 4, right, and if they say if they read the ad and they say to you, this is just as good as pretty good, your ex sucks, images no good, okay, i think if you have this out, No that’s no good.
Do you actually want is they read at, how can I buy some, is my credit card I want to buy some that’s when you know you got something, okay you need the real reaction because people vote with their wallet, don’t listen to Just what they say watch what they do they vote with a wallet, when did minute they put some money online okay I’ve got something, before that is all just like lips, so that’s number one research, knowing identifying do I do, step number, q and that is create an accessible offer, a compelling offer, this is probably the one of the most important steps Indian, higher formula, because you look at most businesses, the biggest challenges, they sound the same as everybody, the office not very compelling, oh you know what, this is my glock my competitors, And didn’t cuddle with you as well, maybe I’m a little bit better and maybe a little bit cheaper, what day is not, huge differentiator, so with what you do not think about how could you make, your offer as compelling as pause, i was talking with, one of a copywriter, and he was asking me well then do you believe, what is Montour, the audience, all the message, i say without a doubt, the market, i could have the greatest message, what I said the wrong people, what is distribution, we will just like yesterday last night we having dinner right, love’s like Rhett meet and all that doesn’t like Steve has so much, so I could have the great like lobster and crab and a great message this is awesome man, i don’t know it’s the right message, but wrong Market, play doesn’t work, so when it comes to offer you have to think about, What is it that your audience truly wants, right what is it that they did cleaning, what more what pain, what frustrations that they have they they just they’re sick and tired of that, so when you can come up with an offer this so irresistible, is easy to sell, in fact a great, offer, you can see, less, anyone still sell, you’ll need to use as many words, let me give you perfect, let’s say it’s a gate he has $100 bill, okay, can you give me $10 in exchange of $100, give me ten bucks I’ll give you $100 right now, that isn’t resistible, right there, what am I doing there is called selling money at a disco, so if you’re selling any kind of, business Improvement, offer or any offer that helps people to make money save money on investment, the concept, money saving money at a discount, Spandex with me, i’m going to teach you how to make, why, right, essay example people who teaches real estate investing, hey spend $5,000 on Discord, i’m going to teach you how to generate you know, 10000 a month in rental income, oh wow that’s a no-brainer, that’s only money at a discount, that’s an irresistible offer, maybe you’re not in the education space maybe you have, do some physical product how do you do this, in so many ways, maybe your irresistible offer is, a free 30-day trial, okay if you have seen those infomercials, where they have those are, skin care, the trifle 30 they see how you like it, example, or a strong guarantee, irresistible, add certain bonuses, jamaican resistant material quick story, the one time many years ago I was late night watching TV, that’s all this, eva Marcille just popped up my loved ones, And this this guy is demonstrating he has a pair of shoes on the desk and his.
Cutting it with a knife, and I’m like, this is cool, what is this is a was talking about house shopping Ibis, is it yeah that’s cool, okay I got the knife and then he cut actually a can, with with a knife, holy s*** this is cool, not going to use it but it’s cool right, so I was watching a commercial and then people like and then he has a lot of, people coming onto the TV talk with a testimonial, using this naive housewife, like people do any kind all kinds of, background that uses knife, and he said well you know what, can you buy today, you don’t just get one night, you get to knife, homelite holyfuck, this is awesome and then he goes on, this is the big knife, But what about All the Small Things, and then you get this knife, and then you get this knife, and then you get this knife, and then before you know what he’s talking about like, twenty f****** divinized, i don’t like this is crazy, this is awesome before the infomercial I don’t need a knife, i don’t need a knife, but offered it is so dramatic and so cool, and then he just dropped the mic and see if you order within the next 5 minutes, you don’t get, these 29th, we going to send you two sets of knives, that’s it I’m done right call number call immediately and by that is, list of offer it when did it the office so irresistible, logic goes out the window, outside bought to set up nice actually the lady cuz I’m like, what the f*** I need like 40 pairs of nice voices stupid I just dumb, It was at that moment it was so compelling, so think about how you could use that, maybe sometimes it’s, faster shipping Amazon that’s good Amazon, proserpine you get a fast, i don’t want to wait when I could also speak about how, you were saying how Amazon offers that fit did you pay them Accenture, that’s right cuz Amazon if you have Prime Membership Eva Prime member, hello, NC, that, with fine what they’re doing is essentially they’re charging you for membership fee, so they can buy more, applicants applying to get your product faster, so think about what Amazon does, and how they encourage you, a simple thing in your system, and it’s not like a hundred bucks or so right they raise the price people, put up a hole stink but everybody’s, bill pay the higher, i have seen people like us now, Amazon, hundred, housing people that you would think Prime is like, it’s a, luxury, everything nice and membership it’s not like a, necessity you’re paying, a hundred bucks you get some benefit in Amazon and, ended a video and entertainment, william painter sponsorship, so you’re paying them so I can buy more stuff, you got understand, i don’t know people, who are like, literally you would think like lower-income, the living in like, trailer park and stuff like that, neither would not think they would spend money on Amazon and yet their Prime members, it’s the last thing you think about, but to them, destify member, and I like you spend $100 a year, but to be a Prime member, is Solaris, it’s like a no-brainer, when you are a Prime member you thinking while you know, i’m going to pay for the shipping anyway, but I’m going to get my stuff faster, Plus you’re not getting all these other benefits I get Amazon need a video I can.
Music, and you may watch email watch it but you like the fact that, you have access, right, that’s irresistible,
from WordPress https://top1course.com/how-to-sell-millions-without-ever-opening-your-mouth-copywriting-secrets-simple-7-step-formula-pt-1/
0 notes
mbaljeetsingh · 6 years
Text
Animate Images and Videos with curtains.js
While browsing the latest award-winning websites, you may notice a lot of fancy image distortion animations or neat 3D effects. Most of them are created with WebGL, an API allowing GPU-accelerated image processing effects and animations. They also tend to use libraries built on top of WebGL such as three.js or pixi.js. Both are very powerful tools to create respectively 2D and 3D scenes.
But, you should keep in mind that those libraries were not originally designed to create slideshows or animate DOM elements. There is a library designed just for that, though, and we’re going to cover how to use it here in this post.
WebGL, CSS Positioning, and Responsiveness
Say you’re working with a library like three.js or pixi.js and you want to use it to create interactions, like mouseover and scroll events on elements. You might run into trouble! How do you position your WebGL elements relative to the document and other DOM elements? How would handle responsiveness?
This is exactly what I had in mind when creating curtains.js.
Curatins.js allows you to create planes containing images and videos (in WebGL we will call them textures) that act like plain HTML elements, with position and size defined by CSS rules. But these planes can be enhanced with the endless possibilities of WebGL and shaders.
Wait, shaders?
Shaders are small programs written in GLSL that will tell your GPU how to render your planes. Knowing how shaders work is mandatory here because this is how we will handle animations. If you’ve never heard of them, you may want to learn the basics first. There are plenty of good websites to start learning them, like The Book of Shaders.
Now that you get the idea, let’s create our first plane!
Setup of a basic plane
To display our first plane, we will need a bit of HTML, CSS, and some JavaScript to create the plane. Then our shaders will animate it.
HTML
The HTML will be really simple here. We will create a <div> that will hold our canvas, and a div that will hold our image.
<body> <!-- div that will hold our WebGL canvas --> <div id="canvas"></div> <!-- div used to create our plane --> <div class="plane"> <!-- image that will be used as a texture by our plane --> <img src="path/to/my-image.jpg" /> </div> </body>
CSS
We will will use CSS to make sure the <div> that wraps the canvas will be bigger than our plane, and apply any size to the plane div. (Our WebGL plane will have the exact same size and positions of this div.)
body { /* make the body fit our viewport */ position: relative; width: 100%; height: 100vh; margin: 0; /* hide scrollbars */ overflow: hidden; } #canvas { /* make the canvas wrapper fit the document */ position: absolute; top: 0; right: 0; bottom: 0; left: 0; } .plane { /* define the size of your plane */ width: 80%; max-width: 1400px; height: 80vh; position: relative; top: 10vh; margin: 0 auto; } .plane img { /* hide the img element */ display: none; }
JavaScript
There's a bit more work in the JavaScript. We need to instantiate our WebGL context, create a plane with uniform parameters, and use it.
window.onload = function() { // pass the id of the div that will wrap the canvas to set up our WebGL context and append the canvas to our wrapper var webGLCurtain = new Curtains("canvas"); // get our plane element var planeElement = document.getElementsByClassName("plane")[0]; // set our initial parameters (basic uniforms) var params = { vertexShaderID: "plane-vs", // our vertex shader ID fragmentShaderID: "plane-fs", // our framgent shader ID uniforms: { time: { name: "uTime", // uniform name that will be passed to our shaders type: "1f", // this means our uniform is a float value: 0, }, } } // create our plane mesh var plane = webGLCurtain.addPlane(planeElement, params); // use the onRender method of our plane fired at each requestAnimationFrame call plane.onRender(function() { plane.uniforms.time.value++; // update our time uniform value }); }
Shaders
We need to write the vertex shader. It won’t be doing much except position our plane based on the model view and projection matrix and pass varyings to the fragment shader:
<!-- vertex shader --> <script id="plane-vs" type="x-shader/x-vertex"> #ifdef GL_ES precision mediump float; #endif // those are the mandatory attributes that the lib sets attribute vec3 aVertexPosition; attribute vec2 aTextureCoord; // those are mandatory uniforms that the lib sets and that contain our model view and projection matrix uniform mat4 uMVMatrix; uniform mat4 uPMatrix; // if you want to pass your vertex and texture coords to the fragment shader varying vec3 vVertexPosition; varying vec2 vTextureCoord; void main() { // get the vertex position from its attribute vec3 vertexPosition = aVertexPosition; // set its position based on projection and model view matrix gl_Position = uPMatrix * uMVMatrix * vec4(vertexPosition, 1.0); // set the varyings vTextureCoord = aTextureCoord; vVertexPosition = vertexPosition; } </script>
Now our fragment shader. This is where we will add a little displacement effect based on our time uniform and the texture coordinates.
<!-- fragment shader --> <script id="plane-fs" type="x-shader/x-fragment"> #ifdef GL_ES precision mediump float; #endif // get our varyings varying vec3 vVertexPosition; varying vec2 vTextureCoord; // the uniform we declared inside our javascript uniform float uTime; // our texture sampler (this is the lib default name, but it could be changed) uniform sampler2D uSampler0; void main() { // get our texture coords vec2 textureCoord = vTextureCoord; // displace our pixels along both axis based on our time uniform and texture UVs // this will create a kind of water surface effect // try to comment a line or change the constants to see how it changes the effect // reminder : textures coords are ranging from 0.0 to 1.0 on both axis const float PI = 3.141592; textureCoord.x += ( sin(textureCoord.x * 10.0 + ((uTime * (PI / 3.0)) * 0.031)) + sin(textureCoord.y * 10.0 + ((uTime * (PI / 2.489)) * 0.017)) ) * 0.0075; textureCoord.y += ( sin(textureCoord.y * 20.0 + ((uTime * (PI / 2.023)) * 0.023)) + sin(textureCoord.x * 20.0 + ((uTime * (PI / 3.1254)) * 0.037)) ) * 0.0125; gl_FragColor = texture2D(uSampler0, textureCoord); } </script>
Et voilà! You’re all done, and if everything went well, you should be seeing something like this.
See the Pen curtains.js basic plane by Martin Laxenaire (@martinlaxenaire) on CodePen.
Adding 3D and interactions
Alright, that’s pretty cool so far, but we started this post talking about 3D and interactions, so let’s look at how we could add those in.
About vertices
To add a 3D effect we would have to change the plane vertices position inside the vertex shader. However in our first example, we did not specify how many vertices our plane should have, so it was created with a default geometry containing six vertices forming two triangles :
In order to get decent 3D animations, we would need more triangles, thus more vertices:
This plane has five segments along its width and five segments along its height. As a result, we have 50 triangles and 150 total vertices.
Refactoring our JavaScript
Fortunately, it is easy to specify our plane definition as it could be set inside our initial parameters.
We are also going to listen to mouse position to add a bit of interaction. To do it properly, we will have to wait for the plane to be ready, convert our mouse document coordinates to our WebGL clip space coordinates and send them to the shaders as a uniform.
// we are using window onload event here but this is not mandatory window.onload = function() { // track the mouse positions to send it to the shaders var mousePosition = { x: 0, y: 0, }; // pass the id of the div that will wrap the canvas to set up our WebGL context and append the canvas to our wrapper var webGLCurtain = new Curtains("canvas"); // get our plane element var planeElement = document.getElementsByClassName("plane")[0]; // set our initial parameters (basic uniforms) var params = { vertexShaderID: "plane-vs", // our vertex shader ID fragmentShaderID: "plane-fs", // our framgent shader ID widthSegments: 20, heightSegments: 20, // we now have 20*20*6 = 2400 vertices ! uniforms: { time: { name: "uTime", // uniform name that will be passed to our shaders type: "1f", // this means our uniform is a float value: 0, }, mousePosition: { // our mouse position name: "uMousePosition", type: "2f", // notice this is a length 2 array of floats value: [mousePosition.x, mousePosition.y], }, mouseStrength: { // the strength of the effect (we will attenuate it if the mouse stops moving) name: "uMouseStrength", // uniform name that will be passed to our shaders type: "1f", // this means our uniform is a float value: 0, }, } } // create our plane mesh var plane = webGLCurtain.addPlane(planeElement, params); // once our plane is ready, we could start listening to mouse/touch events and update its uniforms plane.onReady(function() { // set a field of view of 35 to exagerate perspective // we could have done it directly in the initial params plane.setPerspective(35); // listen our mouse/touch events on the whole document // we will pass the plane as second argument of our function // we could be handling multiple planes that way document.body.addEventListener("mousemove", function(e) { handleMovement(e, plane); }); document.body.addEventListener("touchmove", function(e) { handleMovement(e, plane); }); }).onRender(function() { // update our time uniform value plane.uniforms.time.value++; // continually decrease mouse strength plane.uniforms.mouseStrength.value = Math.max(0, plane.uniforms.mouseStrength.value - 0.0075); }); // handle the mouse move event function handleMovement(e, plane) { // touch event if(e.targetTouches) { mousePosition.x = e.targetTouches[0].clientX; mousePosition.y = e.targetTouches[0].clientY; } // mouse event else { mousePosition.x = e.clientX; mousePosition.y = e.clientY; } // convert our mouse/touch position to coordinates relative to the vertices of the plane var mouseCoords = plane.mouseToPlaneCoords(mousePosition.x, mousePosition.y); // update our mouse position uniform plane.uniforms.mousePosition.value = [mouseCoords.x, mouseCoords.y]; // reassign mouse strength plane.uniforms.mouseStrength.value = 1; } }
Now that our JavaScript is done, we have to rewrite our shaders so that they’ll use our mouse position uniform.
Refactoring the shaders
Let’s look at our vertex shader first. We have three uniforms that we could use for our effect:
the time which is constantly increasing
the mouse position
our mouse strength, which is constantly decreasing until the next mouse move
We will use all three of them to create a kind of 3D ripple effect.
<script id="plane-vs" type="x-shader/x-vertex"> #ifdef GL_ES precision mediump float; #endif // those are the mandatory attributes that the lib sets attribute vec3 aVertexPosition; attribute vec2 aTextureCoord; // those are mandatory uniforms that the lib sets and that contain our model view and projection matrix uniform mat4 uMVMatrix; uniform mat4 uPMatrix; // our time uniform uniform float uTime; // our mouse position uniform uniform vec2 uMousePosition; // our mouse strength uniform float uMouseStrength; // if you want to pass your vertex and texture coords to the fragment shader varying vec3 vVertexPosition; varying vec2 vTextureCoord; void main() { vec3 vertexPosition = aVertexPosition; // get the distance between our vertex and the mouse position float distanceFromMouse = distance(uMousePosition, vec2(vertexPosition.x, vertexPosition.y)); // this will define how close the ripples will be from each other. The bigger the number, the more ripples you'll get float rippleFactor = 6.0; // calculate our ripple effect float rippleEffect = cos(rippleFactor * (distanceFromMouse - (uTime / 120.0))); // calculate our distortion effect float distortionEffect = rippleEffect * uMouseStrength; // apply it to our vertex position vertexPosition += distortionEffect / 15.0; gl_Position = uPMatrix * uMVMatrix * vec4(vertexPosition, 1.0); // varyings vTextureCoord = aTextureCoord; vVertexPosition = vertexPosition; } </script>
As for the fragment shader, we are going to keep it simple. We are going to fake lights and shadows based on each vertex position:
<script id="plane-fs" type="x-shader/x-fragment"> #ifdef GL_ES precision mediump float; #endif // get our varyings varying vec3 vVertexPosition; varying vec2 vTextureCoord; // our texture sampler (this is the lib default name, but it could be changed) uniform sampler2D uSampler0; void main() { // get our texture coords vec2 textureCoords = vTextureCoord; // apply our texture vec4 finalColor = texture2D(uSampler0, textureCoords); // fake shadows based on vertex position along Z axis finalColor.rgb -= clamp(-vVertexPosition.z, 0.0, 1.0); // fake lights based on vertex position along Z axis finalColor.rgb += clamp(vVertexPosition.z, 0.0, 1.0); // handling premultiplied alpha (useful if we were using a png with transparency) finalColor = vec4(finalColor.rgb * finalColor.a, finalColor.a); gl_FragColor = finalColor; } </script>
And there you go!
See the Pen curtains.js ripple effect example by Martin Laxenaire (@martinlaxenaire) on CodePen.
With these two simple examples, we’ve seen how to create a plane and interact with it.
Videos and displacement shaders
Our last example will create a basic fullscreen video slideshow using a displacement shader to enhance the transitions.
Displacement shader concept
The displacement shader will create a nice distortion effect. It will be written inside our fragment shader using a grayscale picture and will offset the pixel coordinates of the videos based on the texture RGB values. Here’s the image we will be using:
The effect will be calculated based on each pixel RGB value, with a black pixel being [0, 0, 0] and a white pixel [1, 1, 1] (GLSL equivalent for [255, 255, 255]). To simplify, we will use only the red channel value, as with a grayscale image red, green and blue are always equal.
You can try to create your own grayscale image (it works great with geometric shape ) to get your unique transition effect.
Multiple textures and videos
A plane can have more than one texture simply by adding multiple image tags. This time, instead of images we want to use videos. We just have to replace the <img /> tags with a <video /> one. However there are two things to know when it comes to video:
The video will always fit the exact size of the plane, which means your plane has to have the same width/height ratio as your video. This is not a big deal tho because it is easy to handle with CSS.
On mobile devices, we can’t autoplay videos without a user gesture, like a click event. It is therefore safer to add a "enter site" button to display and launch our videos.
HTML
The HTML is still pretty straightforward. We will create our canvas div wrapper, our plane div containing the textures and a button to trigger the video autoplay. Just notice the use of the data-sampler attribute on the image and video tags—it will be useful inside our fragment shader.
<body> <div id="canvas"></div> <!-- this div will handle the fullscreen video sizes and positions --> <div class="plane-wrapper"> <div class="plane"> <!-- notice here we are using the data-sampler attribute to name our sampler uniforms --> <img src="path/to/displacement.jpg" data-sampler="displacement" /> <video src="path/to/video.mp4" data-sampler="firstTexture"></video> <video src="path/to/video-2.mp4" data-sampler="secondTexture"></video> </div> </div> <div id="enter-site-wrapper"> <span id="enter-site"> Click to enter site </span> </div> </body>
CSS
The stylesheet will handle a few things: display the button and hide the canvas before the user has entered the site, size and position our plane-wrapper div to handle fullscreen responsive videos.
@media screen { body { margin: 0; font-size: 18px; font-family: 'PT Sans', Verdana, sans-serif; background: #212121; line-height: 1.4; height: 100vh; width: 100vw; overflow: hidden; } /*** canvas ***/ #canvas { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 10; /* hide the canvas until the user clicks the button */ opacity: 0; transition: opacity 0.5s ease-in; } /* display the canvas */ .video-started #canvas { opacity: 1; } .plane-wrapper { position: absolute; /* center our plane wrapper */ left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 15; } .plane { position: absolute; top: 0; right: 0; bottom: 0; left: 0; /* tell the user he can click the plane */ cursor: pointer; } /* hide the original image and videos */ .plane img, .plane video { display: none; } /* center the button */ #enter-site-wrapper { display: flex; justify-content: center; align-items: center; align-content: center; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 30; /* hide the button until everything is ready */ opacity: 0; transition: opacity 0.5s ease-in; } /* show the button */ .curtains-ready #enter-site-wrapper { opacity: 1; } /* hide the button after the click event */ .curtains-ready.video-started #enter-site-wrapper { opacity: 0; pointer-events: none; } #enter-site { padding: 20px; color: white; background: #ee6557; max-width: 200px; text-align: center; cursor: pointer; } } /* fullscreen video responsive */ @media screen and (max-aspect-ratio: 1920/1080) { .plane-wrapper { height: 100vh; width: 177vh; } } @media screen and (min-aspect-ratio: 1920/1080) { .plane-wrapper { width: 100vw; height: 56.25vw; } }
JavaScript
As for the JavaScript, we will go like this:
Set a couple variables to store our slideshow state
Create the Curtains object and add the plane to it
When the plane is ready, listen to a click event to start our videos playback (notice the use of the playVideos() method). Add another click event to switch between the two videos.
Update our transition timer uniform inside the onRender() method
window.onload = function() { // here we will handle which texture is visible and the timer to transition between images var activeTexture = 1; var transitionTimer = 0; // set up our WebGL context and append the canvas to our wrapper var webGLCurtain = new Curtains("canvas"); // get our plane element var planeElements = document.getElementsByClassName("plane"); // some basic parameters var params = { vertexShaderID: "plane-vs", fragmentShaderID: "plane-fs", imageCover: false, // our displacement texture has to fit the plane uniforms: { transitionTimer: { name: "uTransitionTimer", type: "1f", value: 0, }, }, } var plane = webGLCurtain.addPlane(planeElements[0], params); // create our plane plane.onReady(function() { // display the button document.body.classList.add("curtains-ready"); // when our plane is ready we add a click event listener that will switch the active texture value planeElements[0].addEventListener("click", function() { if(activeTexture == 1) { activeTexture = 2; } else { activeTexture = 1; } }); // click to play the videos document.getElementById("enter-site").addEventListener("click", function() { // display canvas and hide the button document.body.classList.add("video-started"); // play our videos plane.playVideos(); }, false); }).onRender(function() { // increase or decrease our timer based on the active texture value // at 60fps this should last one second if(activeTexture == 2) { transitionTimer = Math.min(60, transitionTimer + 1); } else { transitionTimer = Math.max(0, transitionTimer - 1); } // update our transition timer uniform plane.uniforms.transitionTimer.value = transitionTimer; }); }
Shaders
This is where all the magic will occur. Like in our first example, the vertex shader won’t do much and you’ll have to focus on the fragment shader that will create a “dive in" effect:
<script id="plane-vs" type="x-shader/x-vertex"> #ifdef GL_ES precision mediump float; #endif // default mandatory variables attribute vec3 aVertexPosition; attribute vec2 aTextureCoord; uniform mat4 uMVMatrix; uniform mat4 uPMatrix; // varyings varying vec3 vVertexPosition; varying vec2 vTextureCoord; // custom uniforms uniform float uTransitionTimer; void main() { vec3 vertexPosition = aVertexPosition; gl_Position = uPMatrix * uMVMatrix * vec4(vertexPosition, 1.0); // varyings vTextureCoord = aTextureCoord; vVertexPosition = vertexPosition; } </script> <script id="plane-fs" type="x-shader/x-fragment"> #ifdef GL_ES precision mediump float; #endif varying vec3 vVertexPosition; varying vec2 vTextureCoord; // custom uniforms uniform float uTransitionTimer; // our textures samplers // notice how it matches our data-sampler attributes uniform sampler2D firstTexture; uniform sampler2D secondTexture; uniform sampler2D displacement; void main( void ) { // our texture coords vec2 textureCoords = vec2(vTextureCoord.x, vTextureCoord.y); // our displacement texture vec4 displacementTexture = texture2D(displacement, textureCoords); // our displacement factor is a float varying from 1 to 0 based on the timer float displacementFactor = 1.0 - (cos(uTransitionTimer / (60.0 / 3.141592)) + 1.0) / 2.0; // the effect factor will tell which way we want to displace our pixels // the farther from the center of the videos, the stronger it will be vec2 effectFactor = vec2((textureCoords.x - 0.5) * 0.75, (textureCoords.y - 0.5) * 0.75); // calculate our displaced coordinates to our first video vec2 firstDisplacementCoords = vec2(textureCoords.x - displacementFactor * (displacementTexture.r * effectFactor.x), textureCoords.y - displacementFactor * (displacementTexture.r * effectFactor.y)); // opposite displacement effect on the second video vec2 secondDisplacementCoords = vec2(textureCoords.x - (1.0 - displacementFactor) * (displacementTexture.r * effectFactor.x), textureCoords.y - (1.0 - displacementFactor) * (displacementTexture.r * effectFactor.y)); // apply the textures vec4 firstDistortedColor = texture2D(firstTexture, firstDisplacementCoords); vec4 secondDistortedColor = texture2D(secondTexture, secondDisplacementCoords); // blend both textures based on our displacement factor vec4 finalColor = mix(firstDistortedColor, secondDistortedColor, displacementFactor); // handling premultiplied alpha finalColor = vec4(finalColor.rgb * finalColor.a, finalColor.a); // apply our shader gl_FragColor = finalColor; } </script>
Here’s our little video slideshow with a cool transition effect:
See the Pen curtains.js video slideshow by Martin Laxenaire (@martinlaxenaire) on CodePen.
This example is a great way to show you how to create a slideshow with curtains.js: you might want to use images instead of videos, change the displacement texture, modify the fragment shader or even add more slides…
Going deeper
We’ve just scraped the surface of what’s possible with curtains.js. You could try to create multiple planes with a cool mouse over effect for your article thumbs for example. The possibilities are almost endless.
If you want to see more examples covering all those basics usages, you can check the library website or the GitHub repo.
via CSS-Tricks https://ift.tt/2JlNq9L
0 notes
mathandnumberystuff · 7 years
Text
How to calculate exact trig values, part 3
11th roots of unity
This is my third post about calculating exact trigonometrical values based on roots of unity. I am giving the examples for prime roots of unity.
My previous post showed that the 7th roots of unity had square roots and cube roots in their formulas, because 7 - 1 = 2*3. Since 11 - 1 = 2*5, the 11th roots of unity will have square roots and 5th roots in their expression, namely, a sum of 4 fifth roots, each of formulas involving the fifth roots of unity.
Before we start, I want to make a correction to something I said earlier. In my last post I stated that a1 + a2 + a3 + r1*(a1 + r1*a2 + r2*a3) + r2*(a1 + r2*a2 + r1*a3) = 3*r1, and a1 + a2 + a3 + r2*(a1 + r1*a2 + r2*a3) + r1*(a1 + r2*a2 + r1*a3) = 3*r2. In fact, the first left-hand expression equals 3*r2 and the second equals 3*r1. This is the corrected expression for the 7th root of unity:
Tumblr media
Now on to the current calculation.
Here are the 11th roots of unity:
1, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10
Let’s try to find a power cycle that goes through each 11th root of unity once, except for 1, starting with x1.
Let’s try squaring each term. Since x(n) is just x1^n, and x1^11 = 1, then x(a)*x(b) = x((a + b) mod 11). This is axiom 2 from the first post.
x1, x2, x4, x8, x5, x10, x9, x7, x3, x6, x1...
This gives us a cycle of 10, like we wanted. Now to find each root of unity, we are going to be solving a quadratic equation and a quintic equation. Let’s first find the roots of the equation by summing together every fifth term of the cycle, starting from the first, second, third, and fourth, and fifth terms:
x1 + x10 = a1
x2 + x9 = a2
x4 + x7 = a3
x8 + x3 = a4
x5 + x6 = a5
To find each of these values, we will need to find the following values, where r1, r2, r3, and r4 are the four 5th roots of unity not equal to 1, r1 has a polar angle of 2*pi/5, and r(n) = r1^n:
a1 + a2 + a3 + a4 + a5 = s0
a1 + r1*a2 + r2*a3 + r3*a4 + r4*a5 = s1
a1 + r2*a2 + r4*a3 + r1*a4 + r3*a5 = s2
a1 + r3*a2 + r1*a3 + r4*a4 + r2*a5 = s3
a1 + r4*a2 + r3*a3 + r2*a4 + r1*a5 = s4.
Then we can find the five roots by taking the inverse Fourier transform:
s0 + s1 + s2 + s3 + s4 = 5*a1
s0 + r4*s1 + r3*s2 + r2*s3 + r1*s4 = 5*a2
s0 + r3*s1 + r1*s2 + r4*s3 + r2*s4 = 5*a3
s0 + r2*s1 + r4*s2 + r1*s3 + r3*s4 = 5*a4
s0 + r1*s1 + r2*s2 + r3*s3 + r4*s4 = 5*a5
We already know that s0 = x1 + x10 + x2 + x9 + x4 + x7 + x8 + x3 + x5 + x6 = -1, by axiom 1, but s1, s2, s3, and s4 must be calculated via their fifth powers as sums of 5th roots of unity.
The algebra required to solve for s1^5 is so long-winded that it took 2 whole years since I started writing this post before I finally managed to concentrate on it long enough to solve it. There are 3125 values, of 70 different types, to sum in the expanded expression. Each term consists of a product of 5 values of the form a(n), multiplied by a 5th root of unity, each of which need to be expanded into a pair of x(n) values. Here is the result:
(a1 + r1*a2 + r2*a3 + r3*a4 + r4*a5)^5 = -196 - 130*r1 + 255*r2 - 20*r3 + 90*r4.
After substituting into this expression the respective values for r1, r2, r3, and r4 that we calculated way back in the first post, it becomes:
s1 = -979 - 275*√5 - 220i*√(10 - 2√5) + 275i*√(10 + 2√5)
Amazing! I always get a feeling of wonder when I see such large and arbitrary-looking numbers in a formula for such an easy to define value. The only patterns I can see in these numbers are that -979, -275, -220, and 275 are all multiples of 11 - the degree of the roots we are calculating - and that -275, -220, and 275 are all multiples of 5 as well. The divisibility by 5 occurs because all the terms containing a value r(n) could have their a(n) values cyclically permuted to make 5 different terms having the same value, forcing the total number of r(n)-containing terms to be a multiple of 5 for each value of n.
The expressions for s2^5, s3^5, and s4^5 can be found by substituting out powers of r1 for the corresponding powers of r2, r3, and r4 respectively. Their values are:
s2^5 = -979 + 275*√5 - 220i*√(10 + 2√5) - 275i*√(10 - 2√5)
s3^5 = -979 + 275*√5 + 220i*√(10 + 2√5) + 275i*√(10 - 2√5)
s4^5 = -979 - 275*√5 + 220i*√(10 - 2√5) - 275i*√(10 + 2√5)
Now we need to take 5th roots of each of these expressions. The trouble here is in finding out which 5th root to use. As I said in my first post on roots of unity, I am defining c^(1/n) to be the value x having a polar angle equal to 1/n that of c, such that x^n = c, and therefore x has an angle between 0 and 2*pi/n radians. For the other nth roots of c, it needs to be multiplied by one of the nth roots of unity. But we don’t know what s1's polar angle is, so we don’t know if it’s 1, r1, r2, r3, or r4 times (s1^5)^(1/5).
I haven’t found any pattern in which 5th root to choose when, but a calculator can check that:
s1 = r1*(-979 - 275*√5 - 220i*√(10 - 2√5) + 275i*√(10 + 2√5))^(1/5)
s2 = r1*(-979 + 275*√5 - 220i*√(10 + 2√5) - 275i*√(10 - 2√5))^(1/5)
s3 = r4*(-979 + 275*√5 + 220i*√(10 + 2√5) + 275i*√(10 - 2√5))^(1/5)
s4 = r4*(-979 - 275*√5 + 220i*√(10 - 2√5) - 275i*√(10 + 2√5)^(1/5)
Now we can calculate our a(n) values:
a1 = (-1 + r1*(-979 - 275*√5 - 220i*√(10 - 2√5) + 275i*√(10 + 2√5))^(1/5) + r1*(-979 + 275*√5 - 220i*√(10 + 2√5) - 275i*√(10 - 2√5))^(1/5) + r4*(-979 + 275*√5 + 220i*√(10 + 2√5) + 275i*√(10 - 2√5))^(1/5) + r4*(-979 - 275*√5 + 220i*√(10 - 2√5) - 275i*√(10 + 2√5)^(1/5))/5
a2 = (-1 + (-979 - 275*√5 - 220i*√(10 - 2√5) + 275i*√(10 + 2√5))^(1/5) + r4*(-979 + 275*√5 - 220i*√(10 + 2√5) - 275i*√(10 - 2√5))^(1/5) + r1*(-979 + 275*√5 + 220i*√(10 + 2√5) + 275i*√(10 - 2√5))^(1/5) + (-979 - 275*√5 + 220i*√(10 - 2√5) - 275i*√(10 + 2√5)^(1/5))/5
a3 = (-1 + r4*(-979 - 275*√5 - 220i*√(10 - 2√5) + 275i*√(10 + 2√5))^(1/5) + r2*(-979 + 275*√5 - 220i*√(10 + 2√5) - 275i*√(10 - 2√5))^(1/5) + r3*(-979 + 275*√5 + 220i*√(10 + 2√5) + 275i*√(10 - 2√5))^(1/5) + r1*(-979 - 275*√5 + 220i*√(10 - 2√5) - 275i*√(10 + 2√5)^(1/5))/5
a4 = (-1 + r3*(-979 - 275*√5 - 220i*√(10 - 2√5) + 275i*√(10 + 2√5))^(1/5) + (-979 + 275*√5 - 220i*√(10 + 2√5) - 275i*√(10 - 2√5))^(1/5) + (-979 + 275*√5 + 220i*√(10 + 2√5) + 275i*√(10 - 2√5))^(1/5) + r2*(-979 - 275*√5 + 220i*√(10 - 2√5) - 275i*√(10 + 2√5)^(1/5))/5
a5 = (-1 + r2*(-979 - 275*√5 - 220i*√(10 - 2√5) + 275i*√(10 + 2√5))^(1/5) + r3*(-979 + 275*√5 - 220i*√(10 + 2√5) - 275i*√(10 - 2√5))^(1/5) + r2*(-979 + 275*√5 + 220i*√(10 + 2√5) + 275i*√(10 - 2√5))^(1/5) + r3*(-979 - 275*√5 + 220i*√(10 - 2√5) - 275i*√(10 + 2√5)^(1/5))/5
Unfortunately, since Unicode lacks a fifth root symbol (that I am aware of), I had to write the 5th root of x as x^(1/5).
Anyway, we now know the values of x1 + x10, x2 + x9, x3 + x8, x4 + x7, and x5 + x6.
Since x1 and x10 are complex conjugates, (x1 + x10)/2 is the real part of x1. This is the same value as cos(2*pi/11), and it is just a1/2.
Here is an image of what the expression for cos(2*pi/11) actually looks like when written out (with fifth-root symbols in place of x^(1/5)), just to show you how long it gets.
To figure out the value of, say, x1, we will be needing both x1 + x10 and x1 - x10. We already know the x1 + x10 = a1. Let’s call x1 - x10 = t1.
t1^2 = (x1 - x10)^2 = x2 + x9 - 2 = a2 - 2
So, t1 = √(a2 - 2). And just like a1 = 2*cos(2*pi/11), t1 = 2i*sin(2*pi/11).
So:
sin(2*pi/11) = √(2 - a2)/2 = √(55 - 5*(s1^5)^(1/5) - 5*r4*(s2^5)^(1/5) - 5*r1*(s3^5)^(1/5) - 5*(s4^5)^(1/5))/10.
If written out in full, this expression would look similar to the one given above except that:
the numerator is under a square-root sign
it starts with 55 instead of -1 and then subtracts the 5th roots instead of adding them
All of the 5th roots are multiplied by 5
The 1st and 4th ones don’t get multiplied by r(n) values.
The sines and cosines of 4*pi/11, 8*pi/11, 6*pi/11, and 10*pi/11 can be found by doing operations on a1, a2, a3, and a4 respectively.
--------------------------------------
Whew! That was way more complex than the formula for the 7th roots of unity. Next up is the 13th roots of unity, and I don’t think they will be nearly as hard.
0 notes
devphilamaths · 3 years
Link
Solve sec(pi/2+theta) | sec(pi/2 +x) | sec pi/2 + x formula, Find Exact value sec pi by 2 + x
0 notes
devphilamaths · 3 years
Link
Solve sin(pi/2+theta) | sin(pi/2+ x) | sin pi/2 + x formula, Find value sin pi by 2 + x
0 notes
Text
Some Irresistible Integrals, Computed Using Statistical Concepts
#ICYMI: Below are a few integrals that you won't find in textbooks. Solving them is a good exercise for college students with some advanced calculus training. We provide the solution, as well as a general framework to compute many similar integrals. Maybe this material should be part of the standard math curriculum. Here, p, q, r are positive real numbers, with q larger than p.  The Gamma symbol represents the gamma function. It is possible that these results are published here for the first time. These are known as Frullani integrals, although the ones mentioned here are not covered by Frullani's theorem, nor any recent generalization that I am aware of. Indeed, AI-based automated integration platforms such as WolframAlpha can not find the exact value (only an approximation) while they are able to compute standard Frullani integrals exactly. My approach to derive the exact values is different from the classical approaches, as it relies on the statistical concept of expectation, possibly leading to interesting areas of research. How to compute such integrals? These integrals are a particular case of the following main result, proved in the next section: where g(x) / x tends to 1 as x tends to infinity, and f is a bounded function with a finite expectation. Some additional conditions may be required, for instance the fact that there is no singularity point in the above quotient, and that g(x) has a lower bound that is strictly positive. The expectation of f, also called average value, is defined as For instance, if f(x) = sin(SQRT(x)), then the expectation exists, and it is equal to E(f) = 2 / Pi. (Prove it!) The main result introduced at the beginning of this section, is rather intuitive but needs great care to prove it rigorously, including correctly stating the required assumptions on f and g to make it valid. Some cases might require working with non-Riemann integrals. Here we only provide the intuitive explanation. Proof of the main result (sketch) Here p, q and n are integers, with q greater than p. We are interested in the case where n tends to infinity. We approximate integrals using the Euler-Maclaurin summation formula. The approximations below become equalities as n tends to infinity. We used the classic approximation of the harmonic series to make the logarithm terms appear. Note that for large values of k, g(k) is asymptotically equal to k. This was one of the requirements for the formula to be valid.  We also have: Using the change of variable y = x / q in the first integral, and y = x / p in the second integral, we obtain: Let us remark that: * q / g(qy) is asymptotically equivalent to 1 / y (for large values of y) * p / g(py) is asymptotically equivalent to 1 / y * both integrals diverge, so the impact of small values of y eventually vanishes in each integral separately * the difference between the two integrals converges In view of this, we have: This concludes the proof. Related Problems * Four Interesting Math Problems * Curious Mathematical Problem * Two Beautiful Mathematical Results - Part 2 * Two Beautiful Mathematical Results * Number Theory: Nice Generalization of the Waring Conjecture * Yet Another Interesting Math Problem - The Collatz Conjecture To not miss this type of content in the future, subscribe to our newsletter. For related articles from the same author, click here or visit www.VincentGranville.com. Follow me on on LinkedIn, or visit my old web page here. DSC Resources * Book and Resources for DSC Members * Comprehensive Repository of Data Science and ML Resources * Advanced Machine Learning with Basic Excel * Difference between ML, Data Science, AI, Deep Learning, and Statistics * Selected Business Analytics, Data Science and ML articles * Hire a Data Scientist | Search DSC | Find a Job * Post a Blog | Forum Questions https://goo.gl/ubvuZx
0 notes
Text
Some Irresistible Integrals, Computed Using Statistical Concepts
Below are a few integrals that you won't find in textbooks. Solving them is a good exercise for college students with some advanced calculus training. We provide the solution, as well as a general framework to compute many similar integrals. Maybe this material should be part of the standard math curriculum. Here, p, q, r are positive real numbers, with q larger than p.  The Gamma symbol represents the gamma function. It is possible that these results are published here for the first time. These are known as Frullani integrals, although the ones mentioned here are not covered by Frullani's theorem, nor any recent generalization that I am aware of. Indeed, AI-based automated integration platforms such as WolframAlpha can not find the exact value (only an approximation) while they are able to compute standard Frullani integrals exactly. My approach to derive the exact values is different from the classical approaches, as it relies on the statistical concept of expectation, possibly leading to interesting areas of research. How to compute such integrals? These integrals are a particular case of the following main result, proved in the next section: where g(x) / x tends to 1 as x tends to infinity, and f is a bounded function with a finite expectation. Some additional conditions may be required, for instance the fact that there is no singularity point in the above quotient, and that g(x) has a lower bound that is strictly positive. The expectation of f, also called average value, is defined as For instance, if f(x) = sin(SQRT(x)), then the expectation exists, and it is equal to E(f) = 2 / Pi. (Prove it!) The main result introduced at the beginning of this section, is rather intuitive but needs great care to prove it rigorously, including correctly stating the required assumptions on f and g to make it valid. Some cases might require working with non-Riemann integrals. Here we only provide the intuitive explanation. Proof of the main result (sketch) Here p, q and n are integers, with q greater than p. We are interested in the case where n tends to infinity. We approximate integrals using the Euler-Maclaurin summation formula. The approximations below become equalities as n tends to infinity. We used the classic approximation of the harmonic series to make the logarithm terms appear. Note that for large values of k, g(k) is asymptotically equal to k. This was one of the requirements for the formula to be valid.  We also have: Using the change of variable y = x / q in the first integral, and y = x / p in the second integral, we obtain: Let us remark that: * q / g(qy) is asymptotically equivalent to 1 / y (for large values of y) * p / g(py) is asymptotically equivalent to 1 / y * both integrals diverge, so the impact of small values of y eventually vanishes in each integral separately * the difference between the two integrals converges In view of this, we have: This concludes the proof. Related Problems * Four Interesting Math Problems * Curious Mathematical Problem * Two Beautiful Mathematical Results - Part 2 * Two Beautiful Mathematical Results * Number Theory: Nice Generalization of the Waring Conjecture * Yet Another Interesting Math Problem - The Collatz Conjecture To not miss this type of content in the future, subscribe to our newsletter. For related articles from the same author, click here or visit www.VincentGranville.com. Follow me on on LinkedIn, or visit my old web page here. DSC Resources * Book and Resources for DSC Members * Comprehensive Repository of Data Science and ML Resources * Advanced Machine Learning with Basic Excel * Difference between ML, Data Science, AI, Deep Learning, and Statistics * Selected Business Analytics, Data Science and ML articles * Hire a Data Scientist | Search DSC | Find a Job * Post a Blog | Forum Questions https://goo.gl/GSGkCU
0 notes
mathematicianadda · 5 years
Text
Finding $1$, $2$, $3$, $\ldots$, $n$ in a random string of $x$ digits
A weird but an interesting question I thought of ...
Consider this random 100-digit integer that I generated using random.org
$$9771602964370316251552537368279107346523948777589513994616004391156991741564023185294939440725424639$$
This number will most likely have $1,2,3..$ upto $9$ in them. But when we further look into we can also find $10$, (i.e $1$ then $0$ right after) and also $11$. But there's no $12$ in them (i.e no $1$ then a $2$ right after).
So what I want to find out is what will be the approximation of $n$, such that there will be $1,2,3,...,(n-2),(n-1),n$ integers that can be seen inside a random x-digit. Also note that $(n+1)$ can never be found in a random x-digit.
If you say that the 'n' value will change randomly and there cannot be any asymptotic or approximations of that. You're kind of wrong. See, I did this with 9 other random 100-digit numbers and also the 100 decimal places of the famous constants $\pi,e$ and $\phi$. The results are pretty close to $11$. Here are them; (scroll right to see the corresponding $n-values$)
$$\begin{array} {|r|r|}\hline Sl. No. & 100-Digit Integer & n-value \\ \hline 1 & 9771602964370316251552537368279107346523948777589513994616004391156991741564023185294939440725424639 & 11 \\ \hline 2 & 5933798531736924945959336111487355483181228762319970946972332473586986158448822614193445434946714049 & 9 \\ \hline 3 & 0748006010018385701305255708540275105163777493821503992289412752198434315022707697359036044788900096 & 10 \\ \hline 4 & 8895177092192596874320826762636449513223106780359367744719402357085023730983517329137267473940940810 & 10 \\ \hline 5 & 4921918080733246056200145588743524919616898465382373461652822273753544023393089458416653653351525383 & 9 \\ \hline 6 & 6386614054105909456194325500596228770058096441918965347422338768650600045406879715848359336828536144 & 10 \\ \hline 7 & 8599263737601951772329677396723688342052445287633091648167742178784189581850841772769226465303321562 & 9 \\ \hline 8 & 0660623044515625611084768937485195387862394776640249639087054616789402273433078233077669093361145164 & 11 \\ \hline 9 & 8747230800762985911116404157733707704590034002122077023051291424897238915375434573976156208269944527 & 9 \\ \hline 10 & 1177720655605689615530670722522895831819411456667323162088720568188745848931083487687853204730731860 & 11 \\ \hline π & 1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679 & 11 \\ \hline e & 7182818284590452353602874713526624977572470936999595749669676277240766303535475945713821785251664274 & 9 \\ \hline φ & 6180339887498948482045868343656381177203091798057628621354486227052604628189024497072072041893911374 & 9 \\ \hline \end{array}$$
Now take the average of all the n-values and you'll get
$n ≈ 9.8$, for $x=100$
I'm starting to work on $x=1000$ and for a hint $n ≈ 99$ or $100$ and this is just like approximate value of an approximate value, I'll find a good approximate value soon. So what are your thoughts on this? What will be a good expression that could take in the $x$ value and give a good approximate?
I'm got a formula, a crude, anecdotal that could give a value close to what is got. I'll post it soon after a few modifications.
EDIT
Some observations that I did.
$$n ≈ \frac{x}{10}\tag{1}\label{1}$$
Or I can say that for a $x$, the $n$ value is; (Big thanks to @glowstonetrees for an inspiration.) $$n≈9*10^{m−3}\tag{2}\label{2}$$ Where $m$ is the no. of digits of $x$. But we know $x$ is the no. of digits of the given $x$-digit value. So $m$ is like no. of digits of the no. of digits of $x$-digit integer
Now for my own anecdotal estimate of this;
$$n≈\pi^{2\left(\log\left(x\right)-1\right)}\tag{3}\label{3}$$
The reason I chose log is that it is a "slow-moving" function so it doesn't change rapidly. And don't ask me why $\pi$ is there, I don't know I kinda like it. But I also edited it and made it more efficient; so it is;
$$n≈\pi^{2\left(\log\left(x\right)-\sin\left(79.4\right)\right)}\tag{4}\label{4}$$
The reason I chose $\sin(79.4)$ is that $$\sin(79.4)=0.9829353491$$ So I didn't want an exact $1$ as in Eq.3 but a rather a number close to 0.98. And I believe this is an irrational number and $sin(79.8)$ is just an estimate for this.
**
Now to test all these expressions with $x=10000$, from data I got that $n≈999$
$$n≈\frac{10000}{10}=1000\tag{By Eq.1}\label{5}$$ $$n≈9*10^{5−3}\tag{By Eq.2}\label{6}=900$$ $$n≈\pi^{2\left(\log\left(10000\right)-1\right)}≈961.38\tag{By Eq.3}\label{7}$$ $$n≈\pi^{2\left(\log\left(10000\right)-\sin\left(79.4\right)\right)}≈999.6\tag{By Eq.4}\label{8}$$
So yeah even know my equation, i.e Eq 4 did well; I have to say Eq 1 of $n≈\frac{x}{10}$ is really the best bet for simplicity and accuracy.
from Hot Weekly Questions - Mathematics Stack Exchange from Blogger https://ift.tt/2LHdj6d
0 notes