It is important to note that he was not only interested in structure but also in function, so he became a physiologist in addition to being an anatomist. He actively searched for models among those who had significant physical deformities, for the purpose of developing caricature drawings.
His study of human anatomy led also to the design of the first known robot in recorded history. The design, which has come to be called Leonardo's robot, was probably made around the year 1495 but was rediscovered only in the 1950s. It is not known if an attempt was made to build the device. He correctly worked out how heart valves eddy the flow of blood yet he was unaware of circulation as he believed that blood was pumped to the muscles where it was consumed. A diagram drawing Leonardo did of a heart inspired a British heart surgeon to pioneer a new way to repair damaged hearts in 2005. 
An armoured tank designed by Leonardo at the Ch?teau d'Amboise
Inventions and engineering
Fascinated by the phenomenon of flight, Leonardo produced detailed studies of the flight of birds, and plans for several flying machines, including a helicopter powered by four men (which would not have worked since the body of the craft would have rotated) and a light hang glider which could have flown.  On January 3, 1496 he unsuccessfully tested a flying machine he had constructed.
The interior of Leonardo da Vinci's armoured tank
In 1502, Leonardo da Vinci produced a drawing of a single span 720-foot (240 m) bridge as part of a civil engineering project for Sultan Beyazid II of Constantinople. The bridge was intended to span an inlet at the mouth of the Bosphorus known as the Golden Horn. Beyazid did not pursue the project, because he believed that such a construction was impossible. Leonardo's vision was resurrected in 2001 when a smaller bridge based on his design was constructed in Norway. In May 2006, the Turkish government decided to construct Leonardo's bridge. It is expected to be finished by October 2006.
In 1490, he made a sketch that conceptualized a stepless continuously variable transmission (CVT).  Modern variations of Leonardo's transmission concept are being used in some automobiles produced today.  Continuously variable transmissions have been available in tractors, snowmobiles, and motorscooters for many years.
Owing to his employment as a military engineer, his notebooks also contain several designs for military machines: machine guns, an armoured tank powered by humans or horses, cluster bombs, a working parachute, a diving suit made out of pig's leather and a hose connecting to air, etc. even though he later held war to be the worst of human activities. Other inventions include a submarine, a cog-wheeled device that has been interpreted as the first mechanical calculator, and one of the first programmable robots that has been misinterpreted as a car powered by a spring mechanism. In his years in the Vatican, he planned an industrial use of solar power, by employing concave mirrors to heat water. While most of Leonardo's inventions were not built during his lifetime, models of many of them have been constructed with the support of IBM and are on display at the Leonardo da Vinci Museum at the Ch?teau du Clos Luc? in Amboise.
Leonardo kept notebooks throughout his life, in which he wrote daily, often in a private "backwards" or mirror-image handwriting. While the popular belief that he did this to keep some amount of secrecy may have some truth, the more plausible reason is that he did this naturally due to his left-handedness. He wrote about his sketches, inventions, architecture, elements of mechanics, painting ideas, human anatomy, grocery lists and even people that owed him money. These notebooks-originally loose papers of different types and sizes, distributed by friends after his death-have found their way into major collections such as the Louvre, the Biblioteca Nacional de Espa?a, the Biblioteca Ambrosiana in Milan, and the Victoria and Albert Museum and British Library in London. The British Library has put a selection from its notebook (BL Arundel MS 263) on the web in the Turning the Pages section.  The Codex Leicester is the only major scientific work of Leonardo's in private hands. It is owned by Bill Gates, and is displayed once a year in different cities around the world.
Why Leonardo did not publish or otherwise distribute the contents of his notebooks remains a mystery to those who believe that Leonardo wanted to make his observations public knowledge. Technological historian Lewis Mumford suggests that Leonardo kept notebooks as a private journal, intentionally censoring his work from those who might irresponsibly use it (the tank, for instance). They remained obscure until the 19th century, and were not directly of value to the development of science and technology. In January 2005, researchers discovered the hidden laboratory used by Leonardo da Vinci for studies of flight and other pioneering scientific work in previously sealed rooms at a monastery next to the Basilica of the Santissima Annunziata, in the heart of Florence.
St. John the Baptist
Leonardo kept his private life particularly secret. He claimed to have a distaste of physical relations: his comment that "the act of procreation and anything that has any relation to it is so disgusting that human beings would soon die out if there were no pretty faces and sensuous dispositions", was later interpreted by Sigmund Freud, in an analysis of the artist, as indicative of his "frigidity".
In 1476, while still living with Verrocchio, he was accused anonymously of sodomy with a 17 year-old model, Jacopo Saltarelli, a youth already known to the authorities for his sexual escapades with men. After two months of investigation he was acquitted, ostensibly because no witnesses stepped forward though others claim it was due to his father's respected position.  For some time afterwards, Leonardo and the others werekept under observation by Florence's Officers of the Night - a Renaissance organization charged with suppressing the practice of sodomy, as shown by surviving legal records of the Podest? and the Officers of the Night.
Leonardo's alleged love of boys was a topic of discussion even in the sixteenth century. In "Il Libro dei Sogni" (The Book of Dreams), a fictional dialogue on l'amore masculino (male love) written by the contemporary art critic and theorist Gian Paolo Lomazzo, Leonardo appears as one of the protagonists and declares, "Know that male love is exclusively the product of virtue which, joining men together with the diverse affections of friendship, makes it so that from a tender age they would enter into the manly one as more stalwart friends." In the dialogue, the interlocutor inquires of Leonardo about his relations with his assistant, il Salaino, "Did you play the