Jump to content

One over the square root of an expression


jamesadrian

Recommended Posts

I'm trying to write an article on my web site about special relativity.

Does HTML5 provide a way to render one over the square root of an expression on a web page?  The expression has superscripts and subscripts, which I know how to do.

Thank you for your help.

 

Jim Adrian

Link to comment
Share on other sites

See if you can use this:

	<script>
	const recpSqrt = (value) => { return 1/(Math.sqrt(value)); }
	var v = 2; alert('Value: '+v+'\nSqrt: '+Math.sqrt(v)+'\nRecpSqrt: '+recpSqrt(v));
    v = 3; alert('Value: '+v+'\nSqrt: '+Math.sqrt(v)+'\nRecpSqrt: '+recpSqrt(v));
    v = 4; alert('Value: '+v+'\nSqrt: '+Math.sqrt(v)+'\nRecpSqrt: '+recpSqrt(v));
    v = 5; alert('Value: '+v+'\nSqrt: '+Math.sqrt(v)+'\nRecpSqrt: '+recpSqrt(v));
	</script>
	

 

Link to comment
Share on other sites

Wikipedia and other sources use images to represent mathematical expressions on a page. HTML is not well equipped to represent them.

There is an XML-based language called MathML, but it is not well supported by browsers.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...